How do you get back up and get motivated after a really really bad competition ?
It can be difficult, but you have to just regroup and let the bad parts go. Chances are you weren't as bad as you thought.
Everyone else seems much more together and dance better than us.
Don't compare yourself to anyone else on the floor. Everyone is going to have an off night. What you *see* may not be reality. It may be that they are just *really good* at hiding their problems on the dance floor. You can't know what a partnership is like off the floor.
Everything seems to be a problem ...dress ... tails ... shoes ... floor ...
For these things, it's helpful to roadtest your clothing before you hit the floor. The floor there's not much you can do about it.
Sometimes we dont know how we can ever win .... the standard of everyone else seems so much higher than us ....
Seeming is a lot different than being. What you see could be an illusion. Are you dancing in the right category? How long have you been working with your partner?
Everyone else look a lot better, taller, younger, prettier ...
As someone who is 5'2" in flat feet and whose partner is 5'5" in flat feet, I feel your pain about being short. Did I mention we dance Standard? Almost every other couple on the floor is taller than us. I really admire Jean-Marc and France because they are vertically challenged like us and they managed to win the 10 Dance! They are our HEROES.
Do your best to present yourself as the best *you* can possibly be. You have no control over how any one else is going to look. And everyone gets older.

Almost everyone on the floor is younger than me at a competition. I'm old for a professional.

I'm older than some *retired* pros! But I don't let it get me down. Age is nothing but a number.
We fight more, get told off more by our coaches ....
How do you snap out of this quickly ?
The first thing I would do is to take your results/video (you did get video, right?) to your coaches and ask them to critique your dancing. Then, take their advice. That's what you're paying them for.
As far as fighting with your partner, one thing I've done is to take all the blame. Generally that helps to diffuse any anger/frustration on the part of my partner and allows our coach the opportunity to absolve me of it and place it where it *really* belongs

or to give me pointers for making my own dancing better.
The old saying that hindsight is always 20/20 is so true. You can beat yourself up about all your perceived faults or you can resolve to do better. You can't change your past but you can change your future. My dad used to say that every job he ever got fired from was one job closer to his perfect job. Try reframing your perspective such that every bad result is just one result closer to a better result.
Results do not happen overnight. It can take years to perfect that *one* thing that is holding you back. There's no shame in that. Just don't have an unreasonable expectation going in to a competition and you won't be disappointed coming out of it.