Learn conditional statements and loops in Apex
Make decisions in your code with if statements, else and else if chains, and nested conditionals
Repeat work with while loops, do-while loops, for loops, and for-each loops, and control them with break and continue