I want to run the Mathematica file with some extension, like '.m'. But, I don't know, how can I run the code. Please, guide me.
If a file has the extension
.m, then I assume you are trying to load a package into your notebook. This can be achieved by calling the package (say called PackageName.m) into your own notebook by doing the following:
You can type into your opening like
<<PackageName`, which uses the backtick symbol
`. It is probably at the left hand side of your keyboard.
Alternatively, this is a shortcut for the MMA function
Get, given in the documentation here. The first example has the above notation I was talking about. Then
Here is a screenshot so you can see the backtick in action.