Hi ReneRademenes,
Thanks for the post in Apple Support Communities. It's important to make sure your Mac is working as expected, and you're in the right place for help. We'd like to start by getting a few details about the issue.
For clarification, are you finding that your Mac is restarting while you're using apps like Firefox and Safari? If so, do you see any specific messages that your Mac restarted due to a problem, or anything similar?
On the other hand, if you're seeing something unexpected when you turn on your Mac, let us know whether this happens after your Mac has been asleep for a long period of time, and whether you're putting the Mac to sleep using the Apple menu () or by closing the lid. This will help work out how best to proceed.
Cheers.