WARNING: This page is about a different car, the 2020 Mazda CX-30. However, it is still accessible from the selected car via links, so may be relevant.
Install a spare nut onto the drive shaft.
Tap the nut with a copper hammer and separate the drive shaft from the axle.