The game is young, but it's never too early to ask about checks and consequences. White sees that he can play Bg6 and that this would require Black to move his king to d8—on a diagonal with his queen. Then White plays his dark-squared bishop to a5, pinning the queen. What’s wrong with this picture? To pin the queen a piece needs protection, and on a5 White’s bishop wouldn’t have it. But a pin with an obstacle preventing it is no reason to give up. Keep playing with the idea, in this case by being thorough about considering all of your checks with all of your pieces. Here White has a second option: Qh5+. This check is different because in addition to pushing the king to d8 it also provides protection for the dark-squared bishop once it moves to a5. (If Black tries g7-g6, then White plays Bxg6+; this forces the king over, which works fine since the protection for the pinning place has been installed.)
Lesson one: When you are trying to pin the queen, think imaginatively about ways to protect the pinning piece; consider different squares it can use, and whether other pieces might move into position to provide the protection while also inflicting time-consuming checks. Lesson two: Often the most interesting result when you force an enemy king to move is that it steps into alignment with its fellow pieces and creates the makings of a pin. So don't just follow the king as it travels; follow its relationships to the rest of the pieces on the board.