I found regedit on %windows%. i opened it and i go to hklm\software. I accidentaly deleted the keys in there. whenever i open a program, there is always error and crash to desktop. Please help me.

My niece said I should always clean my computer so that it doesn't crash, but she didn't say what to do. I always empty my trash, bulk etc. in my mail accounts and I never save documents. I have only two or three favorites in my favorites file. She also said something about something happening every time you log on and to clean that up too. How do I do that? Thank you in advance for all your help.