Locking cells can be very useful. You are effectively disabling cells from being changed or deleted. Accidentally deleting a formula can be very annoying, as can people typing information where they shouldn't and generally messing up all your hard work.
The best way to look at locking cellsThe best way to look at locking cells, is to actually consider that you will be locking the entire sheet and preventing anything from being changed at all. In order to make sure you and other can type in certain cells, you have to specify which cells will not be locked when the sheet is protected.
Once you have got to grips with the fact that you aren't locking cells, you are locking the sheet and "rescuing" them, there's a very quick way to apply this protection and to quickly lock cells.
Use the mouse to highlight cells in the sheet that you wish to keep enabled (hold control on your keyboard to select non-adjacent cells) and use Home > Format and deselect Lock Cell.
Lock Cell is highlighted by default, meaning all cells will be locked when you protect the sheet. Deselecting this will keep them enabled.
Use the same menu and this time, select the option to Protect Sheet. This is also on the Review tab, with other protection and sharing options.
Once the Protect Sheet dialog box appears, you can simply press OK, to begin protection. Though there are a number of other options.
Other protection and sharing optionsYou can add a password if you don't want other people to enable the sheet again. Handy to prevent people making changes to your file.
You can also specify whether to allow users to perform actions, such as formatting cells, inserting rows and columns and many more options. You can even prevent people from clicking in locked cells to take away that added temptation!