Remember—your iMac does not have a video "card."
Starting with the 2012 models, all iMacs have their video hardware integral with and soldered to the logic board. If the GPU has failed, you need a new logic board.
There is little diagnosis you can do at home but:
1) Heat-related? If the image is fine for a short time right after startup and then starts to break up, you could have an iMac starved for cooling air. Please see my comments on iMac cooling issues and their mitigation in this recent thread:
iMac Maintenance - Apple Community
2) Does the screen image changes when you move the display on its hinge? That can indicate a bad display cable.
3) External monitor test. If you have or can borrow an external monitor, connect it and set it to mirror. If the image is normal on the external, the fault is likely in the display or its cabling.
If the screen errors duplicate on the external, the fault is most like in the video systems on the logoc board.
Of these, only #1 is an at-home fix. #s 2 and 3 need Apple's evaluation and a repair quote.