Geez! What could of caused it in the first place? How can I avoid that again?
Probably the 150,000+ unconfirmed transactions in the mempool... and the massive fees needed to get transactions confirmed these days...
Without seeing what the original TX was, it is hard to say what was wrong with it... My first guess would be the fees were too low (Make sure you're running the latest version of Electrum v2.8.2 and that you have dynamic fees enabled in the preferences).
Another option could be that you were spending unconfirmed outputs from previous transactions... or it was a double spend...