Aside from being sure they come from a reputable source, there are ways to check that your solar eclipse glasses are safe and in good condition. Make sure that the lenses aren’t scratched, torn, or punctured, and that they aren’t coming loose from the cardboard frame. If your solar eclipse glasses are in poor condition, don’t use them.
You can also sometimes tell if a pair of eclipse glasses that claims to be ISO-compliant isn’t really safe by trying them on and looking at bright objects other than the Sun. First, try looking at things like a shaded lamp in your home. If you can see that light, your eclipse glasses aren’t strong enough. If you try this and can’t see the light, try looking at something brighter like a bare lightbulb. This should appear dim through a safe solar lens. If that works, you can try glancing at the Sun through your eclipse glasses. If you find it uncomfortably bright, out of focus, and/or surrounded by a bright haze, this is another sign that your eclipse glasses aren’t safe.