To say that something bad almost happened (but didn't), you can add the word 差点 (chàdiǎn) before the verb. You will also hear 差点儿 (chàdiǎnr) in northern China. There is no difference in meaning between 差点 and 差点儿.
It might help to understand the literal meaning of the structure. The word 差 (chà) has a lot of meanings. In this case, it means "to lack," or "to be short." So in Chinese, the way to say "almost" is to say, "lacking that little bit." If that "little bit" hadn't been lacking, it would have happened. But it was lacking, so it didn't happen。Technically, it almost happened. Just remember: The fact is always opposite with the verb phrase after "差点(儿)," whether the verb phrase contains "没" or not.
Note that the "Verb Phrase" part of the structure is usually something bad or something you don't wish for, and that it didn't happen.
Subj. + 差点(儿) + [Verb Phrase]
You can put 就 after 差点(儿) when 了 is used 了. In this case, 就 can be omitted. 了 comes right before the object if an object is included in the verb phrase.
Subj. + 差点(儿) + (就) + [Verb Phrase] / Adj. + 了
This can get confusing, even though it's really the same pattern (and same logic) with a little added complexity. This pattern goes beyond the difficulty level of the needs of the B1 learner, so to learn more about this usage, see expressing "almost" using "chadian mei".