Do not follow the advice in the Overdose FAQ, it was written by people who don't know what they're talking about.
In an opiate overdose, respiratory depression occurs first and often comes on gradually over a couple of hours. As the breathing gets slower or stops for a short time, fluid can get into the lungs, and the person sounds like they're snoring / gurgling / "breathing heavily". At this point, they need to be turned on their side (google "recovery position" for a picture), their head tilted back and any fluid allowed to come out of their mouth.
If the breathing stops, their heart rate will initially increase as the heart struggles to pump the last bit of oxygen around the body. This can last for up to a minute or longer in some cases. If you find someone like this, roll them on their back, tilt their head back and breath into their mouth. This can keep their heart beating for a very long time. Do four lots of 15 breaths and check their pulse. Continue this until the ambulance arrives and the person will avoid a brain injury from being oxygen deprived.
If their heart stops, you need to start compressions. Have a read of
this for a great overview of basic CPR.