You can turn on cheats in Minecraft by enabling it when you create your world, or by going into your Settings.
While Minecraft is a survival game, it is also a sandbox. Hence, the game allows you to tinker with various core game mechanics like the day-night cycle, phasing through blocks, or testing any block ...
Enabling cheats in this version of Minecraft can be done at any time, and it is actually quite simple whether you are starting a new world or loading a game for a world that is already in progress.