If you avoid eye contact (see cabeceo in 'how to ask', above), the potential asker may get the message that you don't want to dance. If they come up and ask you anyway, a simple, "No, thank you," with or without a big smile or an explanation, should be sufficient.
You may offer a courteous excuse to soften the refusal, for example: "I am resting - would rather not dance to this music - want to finish this conversation," or whatever. If you are hoping to dance with this person some other time, be sure to say so.
If you have declined an invitation to dance with the excuse that you are "resting," it would be thoughtless and/or rude to then accept another offer, even if from a more desirable dance partner, before the song or tanda has ended, unless of course you INTEND to give the first person the message that you don't ever want to dance with them in the future.
You have the right to refuse to dance with anyone, at any time. You have the right to end a dance at any time, even ifn the middle of a song (see next section).