Create a new Modelsim project
File -> New -> Project ...
Chose a name for the project and a location.
Click OK.
Close window.
Important: Each module will
be defined in its own source file. The module's source filename needs to
coincide with the module's name!
In the newly opened Project window right-click and select Add to Project -> New File.
If the Project window is not visible it can be opened from the
View->Workspace menu.
Enter a name for the new source file.
Select source's fyletype (Verilog).
Click OK.
Double click on the newly saved source file in the project window.
Write the code for the source file.
Don't forget to save regularly.