Depending on how old your mac is, it could potentially also be your hard drive starting to fail. Exhaust all other potential fixes before replacing it. And definitely take it to an Apple Store to check for you if you're unsure.
If this is a true Mac (i.e. not a Hackintosh), then Apple Support is probably your best bet.
Otherwise, it sounds like a power-related problem. Did you do any recent hardware upgrades?
Depending on how old your mac is, it could potentially also be your hard drive starting to fail. Exhaust all other potential fixes before replacing it. And definitely take it to an Apple Store to check for you if you're unsure.