Generation matters more than mileage with this compact. The 2011-2015 models earned their troubled reputation through a cascade of PCV valve failures that pressurize the crankcase and blow oil past every seal in reach, valve covers, timing covers, turbo lines all start weeping, turning ownership into a parts-replacement cycle. Coolant systems corrode from the inside out when neglected, and by 100k miles repair bills often exceed resale value. The 2016-2019 redesign fixed most of these gremlins and delivers the comfortable, well-equipped compact GM should have built from the start, but those improved cars are scarce on used lots. Manual transmissions of any year hold up better than automatics. If you're shopping used, a 2017 with 80k miles is a safer bet than a 2013 with 50k, the generation gap is that wide. Skip the first-gen unless you enjoy wrenching or have a trusted mechanic on speed dial.
The Mazda3 is what happens when a compact car decides it's too good for its price bracket, and the interior actually backs it up. The 2.5L engine is bulletproof (owners routinely see 200k+ miles), but the 2019 redesign swapped the old multilink rear suspension for a cost-cutting torsion beam that blunts the handling sharpness earlier models were loved for. If you want a refined daily driver that feels expensive and runs forever, this works; if you want the sporty Mazda everyone raves about, hunt down a 2014, 2018 instead.