You didn't provide much in details AND IF YOU DID ANYTHING YET. I offer this as it helps to narrow down issues or causes.
If you haven't yet, remove side cover(desktop?) and blow out and/or clean the dust bunnies out. Also, check the innards for things that shouldn't be. verify operation of *ALL FANS* anywhere. If laptop, blowout the fan channel or blowhole.
What would cause my computer to shut down immediately after the screen that asks how you want to start - safe mode or normally? The fan is running. Could this be a heat issue or a virus? Please any suggestions? The computer is about 5 years old.