It can be difficult to get into a situation whereby one of your Pawns is able to capture the enemy Queen ...
The main difficulty is due to the Queen's superior maneuverability, versus a Pawn's restricted, standard, one-square advance per turn.
A Pawn's best chance, for capturing the enemy Queen, is probably with a Chess Tactic known as a Discovered Check.
How Your Discovered Check Will Work
The Discovered Check will see two of your units attacking two enemy units, from the same move ... The significant part to all this is that one of the enemy Pieces will be their King.
If you play it right, your opponent will have to safeguard the King, which will leave your other unit to capture the jettisoned Pawn or Piece.
Coming back to your query - you want to have one of your Pieces "Checking" the enemy King; this will be revealed - or 'Discovered' - when your other unit, which is your Pawn, steps forward to attack the enemy Queen.
The following video clip will show this better than words alone: