If and when

If

Use 'if' in a sentence in which an event or situation might happen, might be happening, or might have happened.

Example:

When

You use the word 'when' in a sentence in which an event or is certain to take place/happen or has recently taken place.

Example: