Delta printer. My normal end, configured into Cura:
[[language]]
M104 S0 ; Extruder temp 0, don't wait
M140 S0 ; Bed temp 0, don't wait.
G28 ; Home, to get the head out of the way;
G92 E1 ; Relative
G1 E-6 F300 ; Move back
M84 E0 ; De-energize motors
M106 P0 S0 ;Turn off Main Board cooling fan
My "cancel.g", run by the printer when a print is canceled (after a pause).
[[language]]
; stop.g
; called when a print is cancelled after a pause.
G10 P0 S0 ; Turn off the effector heater
M106 P2 S0 ; Turn off Fan 2\. It cools the drivers. We'll turn it on only while printing. DE 2018 01 28
G28 ; Home. DE 2018 02 01
Note: You probably do NOT want home (G28) in either one of these on a cartesian.