This is one way to sort out your ideas by drawing a flow chart. This is the way professional programmers often create their masterpieces.
Starting with a simple pencil and paper to get their ideas into some form of order.
This is particularly valuable when the system you are defining is a process that moves step by step.
A good example of the would be programming an automatic washing machine or a robot. Of course for very simple programme you wouldn't need to do this.
Step 1: The symbols
A rectangle shows an ACTION example - turn say motor on or off, turn an LED on or off.
A diamond shows a DECISION - example - is the switch on, is the lid closed, has the robot touched anything.