Here, you develop your bishop too early and black puts pressure on it with Ng4. With h3 and then Be3, black can no longer attack the bishop and you have successfully developed your bishop. You could have also chosen to castle. The best move for black though, is Na5 which attacks your white bishop.
when to play h4 (or h6)
I don't think that the weakness is very significant in this case. With h3, you block the g4 square for both the knight and black's light-squared bishop. This is especially significant in the case of the bishop because g4 is the only square on which black's light-squared bishop poses a threat and therefore, h3 is a completely worthwhile move in this case. If you are careful and play the position well, I don't see h3 as having much of a negative impact on your game. On the contrary, it seems that it can only help your position and stem black's development.

Hi !
Sorry if i'm on the wrong forum, and sorry for my bad english as well !
I'm currently reading the excellent Logical chess move by move, and one of the main advice of this book is to not weaken the pawn cover in front of the king. Ok i ear that but sometime, when i'm analysing my game with fritz, he shows me that the best move is h3 (obviously to avoid the jumb of a knight or bishop to g4).
for example here is a position of my last game.
Here i played Be3, to develop my bishop. I saw that the knight on f6 could jump on g4, but i didn't get to scared about it (it was actually next blak's move !), and fritz best move was h3 !
So, have you got any advice about this move. When is it right or wrong ?
Thanks !
Renaud