I have glass containers have metal lids, that I use to keep all of my dry food in so the mice cant get them as we live in the country. Every time I open the jar the coffee, quinoa, or what ever flys out/ or is sucked out when the lid is opened. How do I stop this from happening??
It sounds as though the jars are very full, and the coffee / quinoa particles near the top of the jar get sucked out when the lid is removed. One option would be to keep the jars half-empty. The space between the jar's contents and the lid would act as a "suction buffer" and should keep everything out of the "suck zone".
Keep the jar vertical while loosening the lid, which should prevent contents from being up against the lid.
Once the lid is loose, slowly tip the lid up to open it. This will prevent a large wash of air into the jar as well as acting as a barrier to the contents falling out.
It's likely static electricity generated when the lids rub against the glass of the jar. Most likely your lids have some sort of rubber or plastic seal. If you think back to your school science experiments, you can generate static electricity by rubbing certain types of plastic on glass. Try touching the jar and yourself to something metal to discharge the static electricity first. https://www.hunker.com/13416156/elimination-methods-of-static-electricity-from-glass
I'll assume that the contents aren't flying out because the jar is filled to the brim and you happen to tilt the jar when you remove the lid. This can happen with both screw-top and 'flat' tops (like Milo tins). Flat tops can also cause vibrations (like beating a drum) when they pop open, which would agitate the contents.
Try covering the mouth of the jar with a piece of tissue paper before putting the lid on. When you remove the lid, keep a finger on the tissue so that it stays with the glass part of the jar. You should be able to then gently lift the tissue without sucking out the contents.
Depending on how large the jars are: Open them inside a zip-lock freezer bag. That way, if you do spill something, it will be inside the bag. You can then put the bag/jar down on a counter, remove the jar from the bag, use what you need, and put what is in the bag back in the jar.