To be more specific, you must first find a Lava Charm. An accessory allowing 7 seconds of immunity. (You could just click the above link and read about the Wader components, of course.)
If you want another option, try making an Obsidian Skin Potion or two. Each grants lava immunity for 4 minutes.