Over 25 years in front of screen so here is my recipie:
* flicker-free matte IPS screen
* keeping optimal room light and screen dim
* flux or redshift on linux
* doing frequent breaks and finishing work earlier when I feel eyes may suffer, also intentionally blinking more often to rehydrate them naturally.
* try to not rub eyes with hands, if you need then wash them first.
* habit of changing position and looking at the distance while in thought process
* keeping healthy humidity in the room, especially while room heating or air-con is on.
On TODO list:
* some intelligent audio notification once some long running terminal command finishes or screen updates, possibly paired with webcam to detect my absence.
* switching between dark IDE/terminal theme and usually bright browser pages hurts my eyes, therefore I usually stick to bright themes. Maybe color inversion limited to browser would solve that.
I use flux and my phone's night mode. I also try to look away from the PC and focus on a more distant object once in a while during the day (luckily I have a window right behind me, lots of interesting focus points). I'm not as consistent with this as I'd like to be though. I also had LASIK in 2009 which had the biggest positive impact on my eyes of anything else I've done so far.
If you're asking this because you've noticed something weird with your eyes, things are blurry, or they hurt, go to the opticians. They're best placed to tell you what to do.
Otherwise, I use a couple of lamps to up the ambient light if the light in the room is otherwise too dim. Eye drops can also be helpful if you're using a screen for exceptionally long periods per day.
I don't know if anyone heard of Steve Maxwell, he is a well known fitness educator. He is doing what he calls eye yoga, which is some simple eye exercises.
I wished I rested my eyes more and rehydrated my body more frequently. When I lost my eyes ability to focus it was like an on off switch, it can focus only on my screen after a few minutes of staring at it. After a few months I cant control it anymore and had to wear glasses. Doctor says at age 40 above eyes get dried and lose ability to gocus because the lens is alteady hard
Take a break every 1 hour for 2-5 minutes. Use rehydration drops if you have dry eyes. Avoid low lighting areas and I try to reduce brightness in my laptop if it hurts my eyes. Supplements for Vitamin A,C, B3 etc. are also helpful (use it after a medical advice though).
On the subject of drops, it's worth speaking to a pharmacist about getting eye cream/gel if you find that you suffer from dry eyes.
I used to get occasional headaches, and maybe once or twice a year I'd get a minor corneal abrasion, which I assumed was from stuff getting into my eyes. After a while, I was recommended by a doctor to try an eye cream for night use, and the difference was vast. Alongside my eyes feeling much better, I was sleeping better as well, which the doctor put down to how the eyes move in the head while asleep, and my eyes scratching against my lids.
I use drops during the day when I feel the need to, and on occasion when I feel tired I'll use the eye cream. Since then, no problems with my eyes and no headaches.
If you wear glasses, ask optometrist for computer prescription.
Force yourself to blink when using the computer, https://iristech.co/blink-detection/
Take regular breaks: set 20 min timer, look for 20 seconds at an object at least 20 feet away, https://lifehacker.com/5976390/use-the-20-20-20-rule-to-figh...
Avoid flourescent lighting.
Avoid extended sitting: https://glarminy.com/2016/11/29/sedentary-lifestyle-cause-in...
Install flux or redshift on computer to reduce blue light after sunset.