White pawn on e4, black pawn on e5, and I have watched dozens of new players reach for the white pawn to take it. The pawn on e5 is not in danger from the pawn on e4. It is in the way of it, which is a completely different thing.
Pawns attack the two squares diagonally in front of them and nothing else. Straight ahead is where they walk, never where they strike, and the pawn is the only piece in chess for which those are two different lists. How pawns capture has the full picture.
Four pawns, no moves
h 1 Look at that for a moment, because it is the engine behind a lot of chess. Those pawns will still be there in thirty moves unless a piece comes and changes something. Positions with pawns locked like this are called closed, and they change the value of everything else on the board: knights get better because they can jump over the wall, bishops get worse because they run out of diagonals, and the rooks have no open file to work with.
The two things it changes in your play
A pawn in front of an enemy passed pawn stops it forever without ever being attacked by it. That is a blockade, and the best blockader is a knight, because it sits on the square and still attacks eight others. Grandmasters give up material for that square.
And the pawn you cannot take is the pawn you must go round. If the pawn on e5 is annoying you, the answer is another pawn: play f4 and now f4xe5 is a legal capture, because e5 is diagonally in front of f4. Prising open a blocked centre with a pawn from the side has a name, a pawn break, and it is how nearly all closed positions eventually open.
Endgames run on the same rule. Two kings, two blocked pawns, and the whole game becomes about which king gets to the squares beside the pawn first, which is what pawn endgame puzzles train.