Theres not alot of info to go on so far. What are you running or doing on the PC when shutdown and restarts happen? (generally) Check your CPU and PSU fans for heavy dust build up and make sure they have free movement. Overheating with either could cause these problems. Burning smells of dust or electrical components are fairly easy to detect. Posting some system specs will help out. How old is this machine also?
Post us exactly what happens and we'll be able to help you better. It could be a power supply or heat problem, or there could be issues with your electricity.
That happens from time to time. You can buy dust filters for your PC fans (input ones only!) to reduce its effect.