Are you saying the wire connector came loose from the plunger?
If the wires are there and need to be reconnected or the plunger needs to be replaced, just know this is one of the most frustrating tasks you can encounter.
There is no good (safe) way to assure the brake lights function appropriately without rigging something that is more complicated than fixing the issue.
Anything is possible. I had an old CJ5 in high school that I temporarily used a jumper wire direct from the battery to the tail lights. I routed the wire up and down the shifter where I cut the wire near the shift knob and I'd manually touch the two wire ends together when I wanted the brake light to come on. Super sketchy but it got me around for a few days until I fixed the switch.