There are four conditional tenses in English using if:
The zero conditional is used for scientific facts or statements that are always true.
"If you don't drink water, you die."
"You get wet if you stand in the rain."
When can be used instead of if and the meaning remains the same.
The first conditional is used to talk about the possibility of something happening in the future. We use will to make the first conditional.
"If John invites me, I will go to the party." - John is having a party, but I will only go when he invites me.
"If it snows, we will go skiing." - It looks like there is a chance of snow later. When the snow comes, we will go snowing. No snow, no skiing!
Just like the first conditional, the second conditional is used to talk about the future; however, it refers to situations which are often unreal. It is used to talk about dream situations. Would is used in the second conditional to show an unreal situation.
"If I were a millionaire, I would buy a yacht." - I am not a millionaire. I need to be a millionaire before I can buy a yacht. It is only a dream at this stage. There is a small chance that I could be a millionaire in the future.
The third conditional is used to talk about past events which did not happen. We use it to talk about something that we wish had happened in the past, but didn't. It's used to describe an unreal situation that has no chance of coming true. We use would have + past -participle to make the third conditional.
"If I had passed my exam, my parents would have been happy." - I did not pass my exam, my parents are not happy.
"If I had studied harder, I would have passed the test." - I did not study enough so I did not pass. I know that I should have studied more in order to pass.
Link: How to use IF in conditional sentences