whether can substitute for if in an embedded (indirect) question. In other situations that substitution cannot be made.
I don't know if the knife is sharp.
Also: I don't know whether the knife is sharp.
If the knife is not sharp, it will not cut the bread.
Not: *Whether the knife is sharp, it will not cut the bread.