Chosen Solution
Hello, I had to replace the battery on my iPhone xs max after light water damage (the sim card tray indicator is still white). In the process of putting a new battery in, I damaged the screen which I replaced with a cheap eBay one. Every 15 minutes or so my screen glitches out showing white and black lines (see picture at the end), but it fixes itself when I lock and unlock my phone. I have unplugged the earpiece speaker as I thought this might be causing the issue but the problem persists. Any help would be much appreciated.
Most likely the issue is that you got a bad screen from eBay. Since you said there was water damage to the phone, that could be causing the issue, but I would say most likely it is a bad screen issue. I would recumbent contacting the seller on eBay to see if you can get a new one, or a refund, then try another screen.