Question Is there anything I can to fix my pc from turning off/restarting when I launch a game

Jul 12, 2022
3
1
10
I just upgraded my pc with the specs being:

Motherboard B450 Tomahawk Max 2
CPU: Ryzen 5 5600
GPU: Radeon RX 580
PSU: EVGA 750 GA 750w 80 Plus Gold
RAM: t-force vulcanz 16gb 3000mhz

i am able to boot the computer properly and everything shows up in BIOS, and I made sure my drivers were updated, but when I go to launch up a game like Apex I can sometimes make it to the home screen of the game but then my pc just shuts off/restarts but when I load up league I can stay on the client and do whatever expect for going into a match the computer works fine when I don’t try to load up a game like browsing the web or downloading games off of steam. Is the any solutions for my problem?