How the move works
When a pawn makes its double step from its starting square and lands directly beside one of your pawns, your pawn may capture it as if it had moved only one square. You move diagonally onto the square the enemy pawn passed over, and the enemy pawn is removed from the board.
The capture is only possible from your fifth rank: a White pawn on the fifth rank, or a Black pawn on the fourth. That is the only place an enemy double step can land beside you.
The phrase is French for "in passing", and in notation the move is written like any pawn capture, for example exd6, sometimes with "e.p." added.
Now or never
The right to capture en passant lasts for exactly one move: the move immediately after the double step. If you play anything else, the chance is gone for good, even if the two pawns stay side by side.
Like any capture, en passant is optional, unless it is your only legal move. It must also be legal in the normal sense: you cannot capture en passant if doing so would leave your own king in check.
Why the rule exists
The two-square pawn move was introduced in Europe in the late Middle Ages to speed up the opening. Without en passant, a pawn could use the double step to slip past an enemy pawn that would have captured it on the single step. En passant keeps that capture available, so the faster move does not give an unfair escape.