This is not an easy one, even native speakers don't use it correctly.
The word "literal" refers to the precise, exact, scientific meaning of something as opposed to the figurative or poetic meaning behind something.
"I'm starving" is an common expression meaning you're very, very hungry. "I am literally starving" means that you haven't eaten for many days and you are very sick, if not dying.
"Adele is literally the greatest singer of all time" is something you might hear, but this sentence cannot be true in the real world. People say it this way for dramatic emphasis.
The correct way to use the word would be, "I was literally the last person on the plane", meaning you weren't just *among* the last people, the door shut behind you.
In English, this is how we indicate that we are not exaggerating or speaking figuratively.