Because checkmate ends the game, almost every other consideration is secondary to keeping your king safe. Castling early, avoiding unnecessary pawn moves in front of the king, and keeping at least one defender near it are the basic habits that prevent disasters. Weakening moves like ...h6 or ...g6 should be played only with a concrete reason.
King safety is also a target: many strategic plans aim to provoke pawn weaknesses around the enemy king, trade off its defenders, or open lines toward it. Evaluating any sharp position starts with comparing the safety of the two kings, since the side with the more exposed king is usually the one in danger.