Umm Gee it's a used GPU.. BIG red flag there.
Anyhow, I have an RX580 in the computer I'm using and it's flawless on win11 using HDMI and DP. so..
Just to eliminate some things, Download and install Display Driver Uninstaller. Go into safe mode and have it clear everything. You don't mention what your previous GPU was. If it was an Nvidia have DDU uninstall all it's software too.
After the restart, Install AMD's 22.5.2 driver. Just a side note, it's probably a good idea to shut down as many TRAY tasks as you can before installing.
ASUS TUF X570 wifi, AMD Ryzen 5 5600G, ASRock 6700XT Challenger, Antec Truepower new 700w. 32GB