I want to pause the 3d printer automatic

can anyone tell me?
when i push pause on lcd blue screen at 3d printer, which code on arduino are working?