"Whether" is used to express a doubt or choice between two possibilities:
I'll see whether she is at home (or not at home).
"If" is used to introduce one of two OR MORE possibilities.
"If" used to say that one thing can, will or might happen or be true, depending on another thing happening or being true.
If necessary I can come at once.
Both words can be used very often when the possible answers are "yes" or "no".
He asked if/whether I knew Bill.
The policeman asked if/whether I had seen the accident.