1. When both choices are given, we generally use whether rather than if:
I don't know whether she's coming or not. (It would be possible to use if here, but less common.)
I don't know whether she's coming or not. (It would be possible to use if here, but less common.)
2. Before an infinitive with to we use whether:
I don't know whether to accept their offer or not. (If would not be used here.)
3. We can use whether after a preposition:
It's a question of whether we can agree on everything. (If would not be used here.)
4. Both whether and if can be used in indirect speech to introduce a yes/no question:
Did they say whether/if they were going to be late?
5. After some verbs, we use whether:
I doubt whether they'll make it.
We discussed whether it was the correct decision.