
Greetings to all chess fans! Protecting the king is important and is one of the basic opening principles. Leaving the king in the center can lead to disastrous results. I've been mated in the center so many times in my own games. I'm going to show a sample game and what could happen if the king is left uncastled in the center.
The game started with 1. e4 g6 2. Nf3 Bg7 3. d4 b6 4. Be3 Bb7 5. Bd3 d6 6. Nc3 e6

Unconventional play from my opponent surrendering so much space. Such strategy is employed in blitz games to try to bait his opponent into a reckless attack. I'll take the space and follow basic opening principles. 7. Qd2 Ne7 8. a4

I made this move to discourage my opponent from castling Queenside. I like to attack on the Kingside in this game. 8. ...Nd7 9. a5 c5

Black strikes in the center with c5. It leaves him with a backward pawn on d6 which is a lasting weakness. I'm still following my plan to develop my pieces first and protect my king. 10. O-O cxd4 11. Bxd4 e5 12. Be3 Nc5

My pieces are developed and my king has castled. Black's king is still in the center. It's time for me to attack. 13. Bb5+ Bc6 14. Bxc6+ Nxc6

The weak pawn on d6 is ripe for the picking. 15. axb6 Qxb6 16. Qxd6 Bf8

Now Black's king is truly stuck in the center. 17. Qf6 Rg8 18. Nxe5 Nxe5 19. Qxe5+ Be7 20. Nd5 Qd6

Now a nice tactic to end the game. 21. Nc7+ Kf8

If Kd8 then Rad1 wins the Black queen. But now it's mate in two. 22. Bh6+ { White wins. } 1-0
Qg7 checkmate follows.
Game link: https://www.chess.com/game/live/187900698962?move=0
Conclusion: It's important to castle in the opening phase, at least within ten moves in the game. It hides your king behind a wall of pawns away from the center while connecting the rooks in a single move.