If you are castling king-side, this move can prevent a back-rank checkmate with a rook or queen. It’s also sometimes helpful to allow a bishop to tuck into the spot behind the pawn when under attack. I see top players doing it enough that I don’t think it generally compromises king safety too much.
H3 / H6 pawn move
It can depend when its played. Some disadvantages are losing time during the opening and weakening the pawns in front of a castled king by creating an edge that can be attacked. Advantages are creating a luft for the king to account for back rank weakness, controlling what might be good squares for opponents knights and bishops. Personally, I try to avoid it during the opening unless the potential pin looks uncomfortable, particularly if I've castled prematurely so it might invite a pawn storm. It can be a good move in the middle game to reduce the scope of your opponents knights. Also can create a retreat for a bishop. Often essential as files open up, particularly if you want to lift a rook and double up on a file.
I'm interested in peoples thoughts on this move (or links to any good resources to look at). I see it played occasionally against me and tried it out a bit myself, although it's not a regular part of my openings.
I can see that pushing the pawn forward limits the ability of the bishops to sweep across the board and prevents the bishop/knight/queen pin that crops up every so often...but at the same time, that pin seems quite easy to shake off usually and my concern is always that breaking up the pawn barrier in front of the castle too early seems to be a bit of a risk that a player may find a way to exploit.
The equivalent moves on A don't seem to have the same risks in my mind so seems less problematic but I'd be open to any thoughts/advice on this...