There are a lot of conflicting old wives' tales about how to deal with burns.
The method recommended by the fire professionals is to first remove anything clothing or jewelry that might be making things worse—metal jewellery can heat up and continue to burn after the heat source is removed, and fabrics can absorb hot water and continue to scald.
When all burn sources are removed, immediately run cool water over the wound for several minutes. The water will prevent further burning and relieve the pain.