If there's a glass jar in our house, there's a good chance it's being used to store any number of goodies: batches of minced garlic I like to whir up in my Vitamix, quick pickles, decanted gochugaru (Korean red pepper flakes), a variety of dried spices, remnant soy bean or red pepper pastes.
Because the contents of these jars are usually pungent, I normally don't have any problems using them interchangeably with one another. It's when I need to fill them with milder things like smoothies and jams that I run into trouble.
For the most part, a simple soak with hot water and Dawn usually does the trick. I know baking soda and vinegar are popular deodorizers, too. But when the smells are especially stubborn (Hotline! Alert!), the culprit is not usually the glass jar itself, but the lid. Depending on whether it's a standard screw top or a glass lid with a rubber gasket, the lids are usually what harbor the odors and need some extra TLC.
Even after a soak in a hot, sudsy, vinegary solution, with a follow-up spin through the dishwasher, smells don't always disappear. I usually have to rely on a multipronged approach to get them fresh and clean again, incorporating a tactic my own mom shared with me that works every time.
The sun! There's nothing like good ol' fashioned sunlight to do the heavy lifting for you. It's believed that the sun's powerful UV rays work as a natural disinfectant, and I can see (and smell) the proof for myself when I line up glass jars, their lids, plastic containers (with lids), cutting boards (plastic and wood) out on our balcony for a few hours in the middle of a sunny day. Even kimchi stains, whose tenacity alone warrants a separate cutting board altogether, seem to lighten considerably with a little time in the sun.
If I run into an especially malodorous jar that's adamant against relinquishing its smells, off to the recycling bin it goes! The rest can stay with their fellow sunbathing friends.