IF is a conditional clause in English. This means that one action will/may happen as a result (on the condition) of another action or other actions.
IF can come after the main action:
“I will go to Hawaii if I can find a cheap hotel.”
Or it can start a sentence and end with the main action:
“If I can find a cheap hotel I will go to Hawaii.”
I will go to Hawaii if I can find a cheap hotel. – The main action is ‘go to Hawaii,’ but this action can only happen as a result of ‘finding a cheap hotel.’ (On the condition of finding a cheap hotel)
“I would eat this ice cream if I wasn’t on a diet!”
“If I eat this ice cream I’ll regret it tomorrow.”