If your question is in regard to sunglasses, then yes! Sunglasses are a great way to protect your eyes from the sun’s harmful blue light rays.
If your question is in regard to perscription glasses with blue light filtering lenses, then you’re in luck because I just asked my Optician the same thing. He said that because the technology is new, there are not very many studies that support the idea that some blue light exposure from electronic devices is harmful to our eyesight on a long-term basis. He said the studies that do exist in support of blue light filtering technology consist of unlikely circumstances. For example, rats were exposed to constant, bright, blue light for extended periods of time. With time, the rats’ eyesight diminished slightly so the studies concluded that blue light is damaging, however, the studies are not representative of the amount of blue light exposure most humans are currently experiencing on a daily basis.
Overall, his opinion was that the blue light from the sun is way stronger and more damaging than the blue light from electronic devices. So if you are really worried about blue light, the best thing you can do is wear sunglasses! Also, since the science isn’t really available to back up blue light filtering for electronic devices, he kind of felt like it is possibly a marketing scheme that feeds on people’s fears to make more money.