What happens if you say no to the oath on the witness stand in court?

If you object to being sworn, to taking an oath (as some religions do), then you can “affirm” to tell the truth, the whole truth, and nothing but the truth instead of being sworn to do so.

If you refuse to testify under oath and/or under affirmation, then that can constitute both civil contempt of court and criminal contempt of court. This means you may:

be held in contempt of court for such a refusal, which usually means you will be fined and jailed until you’re willing to tell the truth (and if you refuse to tell the truth to the point that the trial has ended then you will likely be released; and/or

charged with criminal contempt and if convicted (there are defenses to the crime of refusing to testify, and if they apply to you, then you may be off the hook, but you need to assert those defenses at the time you refuse to testify) could be sentenced to another, specific jail term) and/or