Another way (the way I do it) is G91G28Z0
When I reach the end of my program, I will add a line that takes the Y axis and the Z axis close to their tool change positions.
I will use something like:
G0Z1.M9
Y_._ Z_._
M998
G91G28Y0
M30
I don't worry about stopping the spindle with a M5. Your M30 will do that. I turn the coolant off so I have a little time to start blowing the part off while the machine moves away from the part.
Works for me every time.
You can buy GOOD PARTS or you can buy CHEAP PARTS, but you can't buy GOOD CHEAP PARTS.