N3
ところだった ①
Almost, Nearly, About to, On the verge of
やばい、大事な書類を捨てるところだった。
Oh no, I almost threw away an important document.
Explanation
「~ところだった」 means 'I almost...' or 'it nearly happened'. Something bad or unfortunate was about to happen, but luckily it did not. The speaker feels relieved or shaken. It often goes with 「もう少しで」, 「危うく」 or 「あと少しで」: 「もう少しで車に轢かれるところだった」 (I almost got hit by a car). For a good thing that nearly worked out, 「のに」 is often added: 「あと1点で合格するところだったのに」 (I was one point from passing, what a pity).
Mixed up with
Use the dictionary form before it, because the action did not happen. A wrong form is 「×忘れたところだった」.
The 「ところだ」 family: 「V dictionary form+ところだ」 about to do; 「Vている+ところだ」 in the middle of doing; 「Vた+ところだ」 just finished; 「V dictionary form+ところだった」 almost did (this pattern).