user30047: Analyzing my latest game on chess.com, Stockfish says that h4 is the best move here:

I followed the line, but I failed to understand the reasoning of this move. Is it for some long-term advantage? Also, should the enemy bishop be left to stay there?

user23357: Trapping the bishop on c2 is a possibility, but it helps you develop your pieces for a general attack, depending on your opponent's moves.  It adds threats that tie up enemy pieces defending and moves the attack to the enemy.
[FEN "rn1qkb1r/pp3ppp/2p1p3/4P3/2BP2P1/5N1P/PPbBQ3/R3K2R w KQkq - 0 1"]

1. h4 h5 2. Ng5 Be7 3. Qf2 Bg6

Following the engine line (which you can see in analysis on chess.com), black moves the pawn to h5 to give the bishop on c2 a retreat.  That gives an outpost for your knight on g5.  It's always nice to have a knight on a protected square in enemy territory.  Your queen can slide over to f3.  This forces the bishop on c2 back to g6 to protect the pawn on f7 which is being attacked by your queen and knight (or the rook over from h8 to f8 to protect it).
If it didn't get some extra protection, there are two possible attacks which the king couldn't protect.  You could move the queen there to deliver check and force the king to d7.  Then the queen could take the pawn on g7 and threaten the rook.  You'd be up two pawns and have the queen deep in enemy territory.  The other attack is even better though.  You could take the pawn with your knight which would fork the black queen and rook.  Black would have to move the queen and you could take the rook.  Then you could bring the queen in if you want.

user28146: The main idea is to try to trap the c2-bishop. After h4 White is threatening to play Rc1 and black can't save the bishop. That's why black should play ...h5 giving their bishop a retreat square. Note that if h4 h6, then there is Bxh6 and c2 is hanging.

30047: <p>Analyzing my latest game on chess.com, Stockfish says that h4 is the best move here:</p>
<img src="https://i.stack.imgur.com/mPI7E.png" width="500">
<p>I followed the line, but I failed to understand the reasoning of this move. Is it for some long-term advantage? Also, should the enemy bishop be left to stay there?</p>
 23357: <p>Trapping the bishop on c2 is a possibility, but it helps you develop your pieces for a general attack, depending on your opponent's moves.  It adds threats that tie up enemy pieces defending and moves the attack to the enemy.</p>
<pre><code>[FEN &quot;rn1qkb1r/pp3ppp/2p1p3/4P3/2BP2P1/5N1P/PPbBQ3/R3K2R w KQkq - 0 1&quot;]

1. h4 h5 2. Ng5 Be7 3. Qf2 Bg6
</code></pre>
<p>Following the engine line (which you can see in analysis on chess.com), black moves the pawn to h5 to give the bishop on c2 a retreat.  That gives an outpost for your knight on g5.  It's always nice to have a knight on a protected square in enemy territory.  Your queen can slide over to f3.  This forces the bishop on c2 back to g6 to protect the pawn on f7 which is being attacked by your queen and knight (or the rook over from h8 to f8 to protect it).</p>
<p>If it didn't get some extra protection, there are two possible attacks which the king couldn't protect.  You could move the queen there to deliver check and force the king to d7.  Then the queen could take the pawn on g7 and threaten the rook.  You'd be up two pawns and have the queen deep in enemy territory.  The other attack is even better though.  You could take the pawn with your knight which would fork the black queen and rook.  Black would have to move the queen and you could take the rook.  Then you could bring the queen in if you want.</p>
 28146: <p>The main idea is to try to trap the c2-bishop. After h4 White is threatening to play Rc1 and black can't save the bishop. That's why black should play ...h5 giving their bishop a retreat square. Note that if h4 h6, then there is Bxh6 and c2 is hanging.</p>
