MacBook Keeps Restarting than These Reasons Can Be Responsible.

Reason 1. Hardware Conflict New devices can not be compatible Like Ram OR Hard Drive  

Reason 2. Software Conflict Check the software you have installed and Discover corrupt one

Tip 1. Fix disk permissions and  Launch disk utility

Tips To Solve It.

Tip  2. Disable startup items

Tip 3. Changes Can Initiate Kernel Panic.  So Reset your NVRAM or PRAM by pressing   "Option + Command + P + R" after your MacBook is back from restarting.

For More Detailed Solutions SWIPE  UP