Mirrors don't reverse left to right at all, they reverse front to back (or “in" to “out"). All that is happening is that because people are mostly upright (vertical) and their eyes 👀 are horizontal most people are “rotating” the reflection in their minds around a vertical axis and preferentially interpreting it as swapping left and right.
It’s a bit hard to imagine, but if you instead “rotate“ your mental interpretation of the reflection around an axis horizontally through the middle of your body you’ll realise you have turned “top” to “bottom” instead. Imagine you are viewing the mirror standing on your head, and you’ll realise the left and right are not “swapped”.
In fact there is no “swapping" of left vs right OR top vs bottom. The only “swapping" is performed entirely mentally by comparing something against an internal and completely arbitrary reference axis (a bias).
Humans, because of our shape, and our specific biological symmetry, have developed a mental bias towards interpreting it as left vs right, it has nothing to do with the mirror. It’s entirely a mental interpretation with a bias.
How to explore it yourself
Make a cross out of two rods (two paddle pop sticks work fine) and mark each of the 4 ends with completely different colours on both sides of each stick end. Putting coloured ping pong balls over the ends works well too. If you can’t find 4 differently coloured ping pong balls, use white balls and colour them each all over with markers. You need to either use little coloured spheres or colour both sides of the paddle pop stick ends so you can see it clearly when you rotate it as described below. It doesn't have to be spheres or balls of course, it could be small coloured cubes or such.
Something like this:
Then explore it in a mirror. Try rotating it first by 180 degrees around the vertical axis (w.r.t to gravity). Then instead rotate it by 180 degrees it around the horizontal axis. Note how - as long as you only rotate around one of the rod axes - the rotation only ever swaps one pair of colours.
One can even instead rotate around a diagonal and “swap” multiple aspects at once.
Note how the mirror always shows exactly each coloured ball simply reflected back to you, and does NO colour swapping; it is the rotation axis you choose that determines what “swaps”!
The above demonstration shows through physical rotations what most people are doing mentally.
The first vertical rotation case (completely arbitrary) is what most humans are doing preferentially in their minds when interpreting a mirror as “swapping” left vs right.
If at first this all makes your brain hurt a bit, it’s because you have to undo lots of mental conditioning and also mental functions founded in human evolution. Lots of people struggle with this concept, including even many trained physics and maths teachers.
Visit the external links for some more detailed explanations.