Mac restarts again and again
Rather than ask for lots of details here is your guide for quick hardware triage.


Power off the Mac for literally 5 minutes (go make tea or get a paper/pencil to make notes and a clock with second hands).
Power on the Mac holding the option key - once the screen goes grey - note what happens after 60 seconds. Wait another 60 and then power it off.
Power it on and hold Command R. Be prepared for images showing it trying to connect to a network. Make note of what you see and when the screen changes.
Wait up to 10 minutes for a Recovery HD to show up. At this point, you can run Disk Utility and note anything it marks as wrong.


At this point, you will have enough data to ask a follow on question and/or search this site or Apple.com/support for how to diagnose a startup issue.

Also, make note of wall clock times. You will now know how long the machine can run a clean OS (the recovery HD) without restarting itself. That will be useful in comparing how fast it restarts to the old OS or a new OS if you choose to reinstall Mac OS to see if that's the cause of the restarts.