2) Look away from the screen for a minute at least every 20 minutes.
3) Take a longer break and look around a bit every couple of hours.
Think about how we have had a large part of our field of view as blue from the sky over Millenia. Why would it be damaging to the eyes?
For anyone interested in this. Some quick google-fu revealed this to be correct [0] [1]. Blue light is not great for sleep, but there is no evidence for it being damaging to the eyes.
[0] https://pubmed.ncbi.nlm.nih.gov/29044670/
[1] https://www.aop.org.uk/ot/industry/high-street/2017/05/26/bo...
Also, consider getting a pair of fixed-focus "computer" glasses. They won't "preserve" your eyesight, but it's kind of a one-time level-up to let you use those tiny fonts a few more years.
1) Read books. When I'm staring at the monitor for hours my eyes don't move around as much and my eye muscles can get weak which leads to headaches. I've found that simply reading books forces me to move my eyes around enough to correct this.
2) Go for walks outside. When you're walking around outside you'll need to refocus your vision on things at all different distances. This has helped me a lot.
Oh I forgot, I also have black background when doing code.
I have great eyesight but I think that little exercise helps more with revealing strain rather than actually preserving anything.
2) I try to notice the strain in eye muscles. As soon as I notice it I tend to relax and this seem to help.
3) I try to reduce load on eye muscles when possible. Like read less from small screen devices or use bigger font size when this doesn't affect usability.