Question Rx 580 randomly crashing on some games but not on others?

May 8, 2021
before i complain about my problems here are my specs

GPU:RX580 4gb

CPU radeon 3200g

ram: crucial ballistix 16gb 3600MHz

PSU: 750w aerocool 80+ bronze

motherboard: gigabyte A320M-S2h-V2

ok so my problem is, i bought my pc prebuilt with interrgrated graphics on my cpu and then recently upgraded to a pre owned rx 580 4gb which my friend gave to me that he used for gaming but upgraded to a more powerful GPU. So im experiencing some weird artifacts in some games that are like black squares in a diagonal checkered pattern and they usually show up in the same sections of the game (like in a certain shadowy part that i look at often or something) and then in some games my pc just crashes and i have no clue what the problem is.

it has crashed sometimes before in valorant but it is a rare occurrence and has barely happened but it still does it and it is the game where i experience the most artifacts in. I can play apex legends on high graphics with 100fps and it will be really smooth with no crashing and no artifcats and the same with gta too. This is really confusing because i can run those games really easily but when playing roblox just for fun with my friends it will completely crash my entire pc and make roblox stop responding after like 5 minutes of playing it. my main issue is with cod warzone and cod black ops cold war. I cant even get the loading screen to show up before it crashes. It shows me the initialization process and the anticheat loading up and then precisely 3 seconds after the window shows up it crashes both of my monitors to black for around 5 seconds maybe more and then gives me a notification saying "fatal error..unfortunatley, the application has unexpectedly stopped working"

I have already updated my graphics drivers to the latest version and even tried to run it in safe mode but it keeps crashing like this for no reason even though my system should be good enough to handle it?? i have no clue why it is doing this and i need help