As someone new to options, I was in the same boat a few times. I think what you were saying was you "judged" wrong on the direction. In such situations, it was hard to come out whole without losses.
Unfortunately there is no right answers as it is situation specific. Sometimes I rolled out & up high volatility options without paying or "buy back" and hoped eventually my "judgement" prevailed but more often than not I would be better off got out and took losses early.
I don't know if anyone else here has better advices, if so I like to hear it too.
Best wishes.