It is often suggested that removing the SIM card and battery, cleaning the SIM and putting it all back together will cure a number of faults. Most of this advice is wrong because the problems are often caused by other things, sometimes even the network itself. Quite often the act of restarting the phone, as in this case, will co-coincidently 'cure' the fault.
However, some faults are caused by the SIM contacts becoming dirty and going dull. Messages such as 'Insert SIM' or 'SIM Not Valid' can be caused by dirty contacts.
One of the best ways to clean your SIM contacts is to use a pencil eraser or rubber. Simply lay the SIM flat on a desk and gently rub the gold coloured SIM contacts with the rubber. You will be amazed how the dull surface becomes brighter. Then blow off the bits of rubber and finally wipe with a dry piece of kitchen towel. Job done!
Don't use an ink eraser as they tend to be too abrasive. This method, which doesn't require any fluid, reduces the chance of damaging the SIM with contaminants.
I work in IT support, and "reboot your computer" is the FIRST thing we suggest, not the last one when we have run out of ideas. Most problems with computers are caused by badly written software causing memory leaks, or things getting corrupted when loaded into memory - a simple reboot is enough to fix anything like this, as it clears and resets the RAM. For any PC problem the first thing to try is always a reboot; if that doesn't fix it, then other things are tried.
I agree on the SIM comment though - the only problem likely to be cured by cleaning a SIM is a "Sim missing" type of message, but the act of cleaning the SIM involves taking the battery out for a minute or two, which gives the phones memory and capacitors time to fully clear and discharge. People think cleaning the SIM has fixed their problem, but it is most likely the shutdown, discharge and restart that has done it.