Gilladian is very correct about using silica dessicant packages except for these issues...
The Silica that turns pink when it has absorbed moisture is known as "indcating silica gel" and has a chemical in it that is NOT FOOD SAFE! (you can find out about it on line).
The silica packets found in prescription drugs often contain other ingredients like carbon (which absorbs odors), and some others I won't go into.
The silica packets found in prescription drugs have been mostly 'used up' by keeping the drugs fresh so the drug companies can get a longer shelf life.
That said, I found a wonderful product called Dry Spice that is especially made to put in with sugar, spices, almost everything. It is the perfect size and shape to fit in any size spice jar or whatever, is 100% natural, and perfectly food safe...and wors REALLY GOOD!
Check out www.dryspice.com and you will see what I mean.
Readers beware: The user who posted this has an undisclosed affiliation with the above product. Food-grade silica gel is readily available on the market and readers are encouraged to do their own research.