The dictionary says "if" is a conjunction. How is it diagramed in a sentence like
If you brush your teeth three times a day you will not get cavities.
Reverse the sentence:
You will not get cavities if you brush your teeth three times a day.
It is still a conjunction, whether at the start of the sentence or in the middle as it is joining two phrases.