REALLY depends on the episode/writer.
Some episodes are written like that (Will Riker/Thomas Riker)
Some episodes you keep your consciousness throughout the “beaming” process, so you’re technically you the whole way through (Broccoli in Realm of Fear)
It’s fiction and some writers treated it as a suicide machine, and some wrote it as a movement machine. Even the technical details shifted from episode to episode.
Oh, so we do nothing? Yeah, let’s just wait it out until someone magically invents some perfect solution that we can implement all at once.
Or… we chip away at the issue until it gets solved. Lots and lots of small fixes that add up… just like how lots and lots of small problems caused the issue in the first place.