Din's Fire is one of the three spells of the goddesses that you receive from the Great Fairies in Ocarina of Time. The other two spells are: Farore's Wind and Nayru's Love. It can be used to light torches and defeat enemies, but usually not necessary. The only place in the game where it is absolutely required is to enter the Shadow Temple.
How to get it
To get this spell, you must first have beaten Dodongo's Cavern and have bombs. Go to the Hyrule Castle area and follow the road until it splits. On the right side there is a sign saying "Dead end". There is also a boulder in front of you. Throw a bomb at the boulder and go inside. Play Zelda's Lullaby on the Triforce symbol on the floor. The Great Fairy will appear and give you Din's Fire. Voila!