Nonstop Motion is All You Need
To me, going out dancing is not just a social, recreational pursuit, but also an athletic & spiritual one. In my experience, there is a special, deeply euphoric, sort of trancelike feeling, a flow state, that dancing for an extended period of time unlocks. Not everyone knows how to get there, but I think it's mostly about continous motion!
Starting Out
Many people, when they first start going out dancing at clubs & raves, will take frequent breaks and stop to talk to their friends often. There's nothing wrong with this (as long as you're not blocking the dancefloor), it's normal. Not having a ton of endurance when you start is expected, too.
Focus, No Distractions, & Grind
I think anything that causes you to cease moving to the beat for more than ~15 seconds will make it harder to achieve & maintain this desired flow state. This might sound rather difficult, but you don't have to be going all out.
Say you want to order another drink at the bar. instead of stopping dancing entirely and walking over to the bartender, lower the intensity of your dancing and maintain some sort of gentle motion to the beat as you move across the floor. Move your hips back and forth while the bartender makes your vodka soda, then move back to the dance floor before you raise the effort level again. Don't stop.