Chosen Solution

This happens to me randomly occurs when im gaming my specs are GIGABYTE DS3H MOBO RX580 8GB XFX GSKILL AEGIS 2x8gb RAM Ryzen 5 2600 Corsair psu 500w I also have an SSD and a HDD

The first thing to rule out is overheating (CPU, motherboard, hard drive or power supply), then check for bad memory, also test with another power supply. Only after checking ALL of these would I think it was a Motherboard issue. Please do keep me updated. Thank you!