What kind of computer is it? Since the issue seems to happen specifically when you open a game, the most likely issue is a graphics-driver related problem. If you uninstall and reinstall the drivers for the GPU, that may fix it.
Have you been able to find an older driver you could roll back to for your RX 560 or have you updated the driver to the most recent release?
Submit photos and a description of your PC to our build showcase
See other custom PC builds and get some ideas for what can be done
Services starting at $149.99