Apple - iPhone X has a green line on the screen. What is damaged?
It looks like a hardware issue, display or cable hard to tell, but I'd guess display itself.
A quick test to make sure it's not earlier in the structure is take a screenshot & look at it on another machine, phone, pad, computer. The line won't be there in the screenshot if it's a hardware fail after the GPU.
In my experience, as a former Apple Authorised Service Provider, this issue often appears together with multi-touch issues on the iPhone X and comes down to the display unit. There is a repair program for iPhone X devices with touch issues.
I'd suggest a visit to the Apple Store or an Apple Authorised Service Provider and see if they can perform the repair under the program or otherwise perhaps wait a little bit until the issue occurs (again, in my experience, it most likely will do so, if only intermittently) and get it replaced then.
Opinion: I'd advise against replacing the display yourself on an iPhone X (or any (splash-) waterproof iPhone for that matter) unless you really know what you're doing since not only is opening it a pain, but so is resealing it properly. Apart from the fact that it's very hard to get decent replacement parts.