I assume you created a notebook, wrote something in it, then used File -> Save As... and chose "m. file"?
First of all, if you are looking for create a plain text Mathematica script (.m file or .wl file), it is best not to use notebooks at all. Create an .m file directly, and edit that.
That said, if you need to save a notebook as an .m file, only "initialization cells" will be included. Cells may be marked as "initialization cell" individually, or in groups. Check Cell -> Cell Properties. Some cell types, such as Code
cells, have the "initialization cell" property by default. Input
cells do not.
A simple way to add the initialization property to many cells at once is to place them under a Section
heading (add a Section
cell type above them), select the cell group, and add the "initialization group" property to it.