Any tips how to prevent green lines?
my guess is to avoid heating up the phone too much for too long. i'm not sure 100% but i suspect mostly happening due to heat dmg to some component on the screen. a lot of report is after software update lines show up, but that is likely just because phone will heat up a lot during update, and sometimes phone will check for updates when is connected to power, and charging will cause more heat. then some folks also like using more protective cases which means thicker and trap heat, and some folks might leave their phone on bed/sofa while phone is charging, which traps even more heat. my sister has a xiaomi 11t pro which got the greenline after a software update exactly because of these circumstances. she said phone was very very hot after update, then green line showed up after that.
also, it's likely that older phones might be more prone to this since their heat dissipation usually not as good, plus some of the older generation chips tend to run quite hot to begin with. and could be some older OLED panels are just more susceptible to such dmg. newer phones might fare better. then the other possibility could be drop dmg too if somehow enough force to dmg in internal screen components. even if use a case, some of the force might pass through the phone too.
personally, i just have a small usb/battery powered fan on my desk that i use to blow at the phone when gaming, charging, or just doing software update. cheap and effective at keeping the phone cool. even if end up green line isn't due to heat, reducing heat will still be better for other internal components like battery/processor in the long run too. ¯\_(ツ)_/¯