One of my chess opponents said that he doesn't think castling is good because the king is in the corner and it is easy to checkmate. However, many articles and books suggest that I castle early when I get a chance. Why is castling a good move in chess?
Castling is generally a good move because it gets your king out of the center in the early and mid game. The center is contested in the early and middle game. The classical idea behind controlling the center is that with more space to place pieces and maneuver, that player has a positional advantage that can transform into a tactical advantage if their opponent plays imprecisely. Getting the king away from tactics and scary pieces is a good way to avoid getting checkmated. Once those scary pieces have been traded off, the king is best placed in the center where it is often the most powerful piece of the endgame.
It's true that the king is easier to checkmate in the corner, but the king is also easier to defend in the corner.
Chess is a game of specific posiitons more than one of general principles. Normally, kings are safer in the corner because players want to fight for the center, so it's not a good idea to have the king in the middle of the action. But this doesn't mean that a castled king will always be safer than one in the center or vice-versa