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.