EOS M doesn’t have a deep history, dating back to only 2012, several years after mirrorless cameras first appeared. Moreover, Canon was clearly tentatively experimenting early on, so we only got a few cameras and lenses at first, and they were not distributed worldwide.
Today, we have a lineup of four current cameras (M5, M6, M50, M100), though two earlier models are still sometimes available (EOS M3, M10).
Body-wise, I’d say things are relatively simple: buy an EOS M5 if you want an EVF. Perhaps consider the M6 if you’re looking for a body with no EVF. The older cameras aren’t up to the levels of the M5/M6. The M50 is a significantly feature-reduced version of the M5 if you’re really are on a budget. Don’t get swayed by it’s 4K video, as that comes with a lot of gotchas you probably won’t like.