Don't rely on glasses alone - that's the most common mistake. Blue light filters might theoretically help, but the real problem is that you blink less when reading on screen and your eyes dry out. On top of that, there's the strain because the monitor is closer than normal reading distance and your eye has to keep adjusting focus. An expensive specialty glasses won't really fix that.
The most important thing is taking regular breaks - even 10 minutes every two hours makes a huge difference. Use that time to look into the distance (ideally 20+ meters away), because that relaxes your eye muscles. Additionally: blink more consciously, move the monitor a bit farther away, adjust screen brightness to match your surroundings, and check your room lighting - lots of people work with a way-too-bright monitor in a dark room, and that puts extra strain on your pupils.
If you still want to buy glasses, that's fine, but more as a supplement. Some people report that artificial tears help them too - just grab a bottle of eye drops and use them a few times a day. It's cheaper and often helps with dryness better than any filter. But in the end it's a mix: more breaks, better screen positioning, and regularly looking away from the screen.