This question already has an answer here:
I've heard of a trick called "En passant" but what does it mean?
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Not a trick. En passant is a rule of pawns in chess just as the rule for 2 square starting advance is. In fact its introduction to the rules came directly from the 2 square advance's introduction.
Essentially the rule prevents an opponent's pawn from blowing past your pawn using it's initial 2 square advance. If your opponent moves their pawn 2 squares past the point where your pawn could capture it, then you may move your pawn to capture it anyway. Your movement is the same diagonal attack into the square that the opponent's pawn would have occupied had it advanced only one square.