It depends on the cause. Most screen-related "eye pain" is really eye strain, fatigue from long close focus, low blinking, and glare, and the fixes are the 20-20-20 rule, matching brightness to the room, blinking, and taking breaks. Blue light glasses can add glare comfort, but they aren't a treatment for pain.
Genuine eye pain, sharp, persistent, or paired with redness or vision changes, is a different matter and worth seeing a doctor about promptly. Don't write that off as ordinary screen strain.