I didn't say keep staring at a screen when it hurt especially if it's a new one and you're not used to it, Do something like 20 mins of work and then leave your monitor until you feel okay to work again, I found also applying oil based eye drops before work to help when you try to adapt to a new screen, You should absolutely listen to your body
It took me about 2 months to start adopting to my new monitor "24 inch curved asus monitor 120 HZ" before deciding to go back to my old laptop which took me about 1 week to start adopting to it again because I guess my brain starting to forget it, But the adaptation rate was much faster than the 24inch monitor
If you look at the development of the baby inside the worm the eyes are the first thing they develop within the brain which indicate how heavily eyes are integrated within the brain, Try this when you have eye strain shake your head you'll feel all of your brain hurt not just your eyes
I also used to think this problem is caused by the eye muscles but now I believe it's caused by the brain
One more tip when adopting to a new screen use a pomodoro software to force you to stop working.
You're welcome!