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 差点儿 in Chinese grammar.

Literal Meaning
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... it almost happened.

Structure
Note that the "Verb Phrase" part of the structure is usually something bad, and that it didn't happen.

Examples

Wǒ men duì chà dián ér shū le.
我们 队 差点儿 输了。
(the team didn't lose)Our team almost lost.