Input devices and screen turns off but the fans to the computer are still spinning. What should I do?

My computer randomly stops functioning no matter what I am doing with it at the moment. The keyboard, mouse, and screen turns off. The lights of the power button stay on but the button does not respond to me pressing the power button. The fans of the computer continue spinning. I have to pull the power cable to get the computer to turn off. Even after that, the lights to the power button stay on for about 10 seconds. When I plug in the power cable again and try to boot the computer it works fine for a whole day or so.

Any help is appreciated!

Computer specs:
Motherboard: GIGABYTE B450M DS3H
CPU: AMD Ryzen 5 2600X (Pinnacle Ridge, PiR-B2)
3600 MHz (36.00x100.0) @ 2694 MHz (27.00x99.8)
Motherboard: GIGABYTE B450M DS3H-CF
BIOS: F50, 11/27/2019
Chipset: AMD B450 (Low-Power Promontory PROM26.A)
Memory: 16384 MBytes @ 1463 MHz, 16-18-18-36
- 8192 MB PC25600 DDR4 SDRAM - Corsair CMK16GX4M2B3200C16
- 8192 MB PC25600 DDR4 SDRAM - Corsair CMK16GX4M2B3200C16
Graphics: Powercolor RX 5700 Red Devil/Dragon
AMD Radeon RX 5700, 8192 MB GDDR6 SDRAM
Drive: Samsung SSD 860 EVO 1TB, 976.8 GB, Serial ATA 6Gb/s @ 6Gb/s
Drive: ST4000DM004-2CV104, 3907.0 GB, Serial ATA 6Gb/s @ 6Gb/s
Drive: SAMSUNG MZ7LF128HCHP-00004, 125.0 GB, Serial ATA 6Gb/s @ 6Gb/s
Sound: ATI/AMD Navi10 - High Definition Audio Controller
Sound: AMD Zen - HD Audio Controller
Network: RealTek Semiconductor RTL8168/8111 PCI-E Gigabit Ethernet NIC
OS: Microsoft Windows 10 Professional (x64) Build 18363.657 (1909/November 2019 Update)
PSU: It is a few weeks old.
After updating the graphics driver for my RX 5700 I have not experienced any more problems. I have tested the computer for multiple days. I will update this thread if I experience more problems!
Thank you for your time!