How do you make sure a debate does not serve your opponent’s interests?
The worry is legitimate and it covers two different risks.
The first risk is the format. Accepting a badly built debate can indeed serve your opponent: a three-minute clock rewards the soundbite and punishes nuance, equal speaking time suggests equal solidity, an edit cuts you off. This risk is dealt with beforehand, by negotiating the frame rather than refusing the exchange. Who moderates, how long, what question, what broadcast format. Refusing a format is not refusing the debate.
The second risk is the one you create yourself. Much of what "serves the opponent" comes from our own reflexes: the straw man, which hands them the role of the misunderstood, the personal attack, which hands them the role of the victim, or losing your temper, which hands them the stage. It is generally your own behavior, not theirs, that produced the moment you regret. Depending on your level of skill, you can therefore assess that risk.