We use "almost" when something didn't quite happen. It could have easily happened, but for whatever reason, it didn't. For example:
1. I almost fell, but I grabbed the railing.
2. She almost got hit by a car, but it swerved at the last second.
3. I almost forgot my homework in my dormitory, but my friend reminded me about it.
Hope this helps!