Step 1: What you need
A small dirty jar that needs to be cleaned
Warm tap water (not pictured)
Liquid dish soap
This technique is also fantastic for cleaning bud vases or salad dressing cruets as well.
If you do not have plain rice on hand, coarse salt or quinoa may work. I have not tried them for this purpose but they seem small enough and should be abrasive enough to do the trick.
Step 2: First pass
Then, add a pinch of rice and a small drop of your dish washing liquid. If your dish soap is a concentrated variety, use a very scant drop!
Now, shake that jar! Try to shake it in different directions to get the rice and water into any funny corners.
Step 3: Second pass
Refill your jar roughly half full with warm water. You do not need to add any rice or soap here. Now, repeat your shaking process to break loose any stubborn gunk in the corners.
If at this point your container is not quite as clean as you need it, you can certainly dump out the water and re-start the first pass. In my experience that is rarely needed though.