Here is a finer point related to conditional sentences:
But for …
If John had not warned me, I would have had an accident. = But for John’s warning, I would have had an accident. [Convert the negative first part of a 3rd conditional into ‘But for’ + noun.]