Before you start using the fog command, or any other command in the game, you need to enable commands in your world. If you are creating a new world for it, then you can check the “Enable Cheats” ...
First, players must understand how the tick command actually works. Tick is the basic unit of time in Minecraft. Every tick is around 0.05 seconds in real life. Hence, each second has 20 ticks in it.