Sentences can consist of multiple parts.
If I work during the day, I can relax at night.
If I finish my homework, I will go to the party.
I will go to the party if I finish my homework.
In red we can find the IF-clause, the other part is called the MAIN-clause.
IF is the condition, the result is the MAIN clause.