I recently posted about Photoshop flashing the work window black about 3-4 times a second, which makes it unusable until it stops. Originaly, it only did it whilst I was working outside of Photoshop - now it's doing it when working on the document (incredibly frustrating when you suffer from epilepsy, as I do!!!). Last time, it was suggested that I turned off "Using Graphics Processor" in the Performance preferences which did the trick for a little while (I marked the answer as correct, now no longer the case). I'm using a late 2015 iMac 27" (32GB RAM, dual monitor setup), Mojave 10.14.6, Photoshop 22.2.11. It's only in the Photoshop window, so not an overall graphics card issue, and clicking on the document stops it right away until it starts again - currently about once every 2 minutes or so. Seriously frustrating!
We're sorry about the trouble with Photoshop. Have you tried disconnecting the second monitor to check if you still experience the issue with only the iMac screen running? If not, please try that & let us know how it goes.