This is a great topic and really important!!
I work on screens all day, have for years, and have occasionally had problems that scared me really good..... Since then I'm much more careful with my vision, after all I do enjoy seeing the trees, the flowers, bees, etc.
First, if you're using a computer, be at least an arm's length away. If you're using a laptop, get an extra keyboard, which will allow you to put the laptop up higher even with the top of your head, which will also help with neck pain.
There are alarms you can set or apps you can use to do the 20-20-20 thing: every 20 minutes, look at least 20 feet away for at least 20 seconds. I live on a ridge and like to look out my window into my garden and then out to the other ridge I can see. There is a Chrome extension that is an easy fix, but there are a lot of other options.
https://chrome.google.com/webstore/detail/eyecare-protect-your-visi/eeeningnfkaonkonalpcicgemnnijjhn?hl=en
I also have a pair of gamer glasses, which are a +1.25 prescription with a blue-light coating (they're yellow). When my eyes are strained, I use them (still at distance from the screen). And I keep eye drops right next to my computer, and try to use them as often as I can remember to.
(an odd note. I have worn contact lenses on and off for the last 30 years. I have a medical condition that means that in the next 10 years or so I will probably no longer be able to wear them, so I'm slowly learning to wear my glasses. I don't like them, I don't feel like I see as well, lots of whiney excuses. The only time I've ever gotten a corneal ulcer, in all of these years of wearing lenses for weeks at a time, was when I took out my lenses to start wearing glasses, ironically. The doctor explained that I was so used to the protection that contact lenses gave my eyes that I got used to blinking less, and when I stopped wearing contacts my eyes dried out. The moral of this story is blink, blink, keep blinking, and then blink more.)