Cocaine users are being asked to consider carrying naloxone after a person died from accidentally ingesting heroin.
Authorities say a batch of the purported cocaine that contains heroin is circulating in Sydney.
Two other people were hospitalised for heroin overdoses after using a substance they thought was cocaine.
NSW Poisons Information Centre medical director Darren Roberts said snorting as little as one line of heroin could result in an overdose.
"One of the dangers of illicit drug supply is the strength and contents of the substance you are getting is unknown and can be inconsistent," Dr Roberts said.
"It's important that people recognise the signs of an opioid overdose early and know how to respond."
Opioids such as heroin can cause pin-point pupils, drowsiness, loss of consciousness, slowed breathing/snoring and skin turning blue/grey.
Dr Roberts suggested people who use cocaine consider carrying naloxone.
Naloxone is a medication that reverses the effects of opioids and does not require a prescription. It is free in NSW for those at risk of accidental overdose.
It is available as a nasal spray or injection from some pharmacies and other health services.
NSW Health said anyone who has taken a stimulant drug, such as cocaine, and is experiencing unexpected symptoms should call Triple Zero
"You won't get into trouble for seeking medical care. If you feel unwell, or if your friend feels unwell, do something about it," NSW Health said in a statement.