"if" is used in conditional sentences
e.g. If I eat cornflakes today, I will not have porridge.
"Whether" is not used in conditional sentences.
"if" and "whether" have the same meaning in this kind of sentence, where there are two (or more) options
e.g. I don't know if/whether I will eat cornflakes or porridge. I haven't decided yet.