They resigned...mostly. Seeing as their states had, per their lights, left the Union they viewed their service in the Congress at an end. After resignation, most went right home where they either sought some kind of office with the Confederacy or left politics for a while. One of the knock-on effects of this was to give the Republicans a healthy majority in Congress that they would not have had otherwise.
But I did say mostly. Some Representatives, and one Senator, from the rebelling states stayed behind and maintained their seats. These men disapproved of secession and generally represented whiter parts of the South with smaller enslaved populations. Such white belts, usually places where plantation agriculture wasn't economically viable at the time, were a source of persistent tension in Southern politics. The loyalty of the local whites to slavery was suspect, and they were inclined to use that perception to get concessions from the planter-dominated state governments by flirting with abolition. When push came to shove, some of them really were prepared to levy war against the enslaver elite, which is why we have West Virginia today.
The one Senator is Andrew Johnson. Johnson had enslaved people himself and was a staggering racist, both common traits in the white South's officeholders. He also came up poor, which is less usual, in a much less enslaved part of Tennessee. (Ditto.) He fancied himself a champion of the Common White Man against the moneyed elites, as was customary for Democrats of the era, and would have no truck with this treason business when it got going. He retained his seat until appointed military governor of Tennessee, at which point he went off to Nashville to do his part in suppressing rebels.