The simple version of RESTORE is:
RESTORE DATABASE db FROM DISK = 'C:\somepath\somefile.bak'
If you are taking a copy of a database from a different server, the path for the files may not work, and in this case, you get an error. In this case, you need to use the WITH MOVE clause:
RESTORE DATABASE db FROM DISK = 'C:\somepath\somefile.bak'
WITH MOVE 'db' TO 'D:\somdatapath\db.mdf',
MOVE 'db_log' TO 'D:\somelogpath\db.ldf',
In this command 'db' is the logical name of the data file. This often the same as the database name, but not always. 'db_log' is the logical name of the log file, and again this is often the database name with _log tacked on, but not always.
If these names do not work, you can use this command:
RESTORE FILELISTONLY FROM DISK = 'C:\somepath\somefile.bak'
And you will have the logical files in the first column.
When it comes to the paths for the database files (those that follows TO), you may or may not where to put them. When in doubt, run sp_helpdb on another database and copy the paths for this database and changes. The file-name part should preferably agree with the database name and with .mdf for the data file and .ldf for the log file.