Literally means exactly, word for word. Figuratively means in a symbolic or metaphorical way. If you would not want the words taken exactly, figuratively is the safe choice, or drop the adverb altogether.
The core difference
Literally points to what is exactly true, while figuratively signals a metaphor or picture rather than a fact.
- literally — exactly as stated: He literally ran five miles this morning.
- figuratively — as a metaphor: She was, figuratively speaking, on top of the world after the win.
How to tell them apart
Test the sentence: could it be checked as plain fact? The translator rendered the poem literally can. On top of the world cannot, because nobody is standing on the planet, so figuratively fits.
The mix-up shows up because literally is also used informally for emphasis, as in I was literally dying of laughter. To keep your meaning clear, use literally for things that are exactly true and figuratively when you want to flag a metaphor.