Warding Candles are crafted with a string over a pig fat over a wooden slab. Pig fat can be gained by slaying pigs, but it is an uncommon drop.
The main use for Warding candles is in rituals such as the ritual of purification. It can also function as a mobile light source if you hold it. However, it will only last a total of fifteen minutes before it breaks; after that, you must make a new one. Sneak clicking a block will attune the candle to that block, and it will now change colors when close to that block (5 blocks=red, 15 blocks=blue, farther than 15 blocks=normal). Once a candle has been attuned, it cannot be unattuned, and can no longer be used in rituals.