Question Pc keeps going black

Feb 4, 2021
6
0
10
I recently got a pc and sometimes it goes black and freezes. Whenever that happens I have to hard reset my pc. Is there a way to fix this?
my specs are that i know of( im new into all this pc stuff)

Gigabyte GA-AX370M-DS3H-CF
AMD Ryzen 5 2600
AMD RX 580
Adata DDR4 2400 2OZ 2x8GB
Adata SU650 240GB
Seagate Barracuda 2TB