Introduction
Control flow tells the script what to do next. It helps decide which parts run and when, so your script works step by step.
When you want to repeat a task multiple times, like checking files every minute.
When you need to choose between two or more actions, like asking if a user wants to continue.
When you want to stop running a script if something goes wrong.
When you want to run different code based on a condition, like if a number is big or small.