Fentanyl works by binding to the body's opioid receptors, which are found in the brain, spinal cord, and other organs. These receptors help in controlling pain and emotions. When fentanyl binds to these receptors, it can significantly reduce the sensation of pain and produce feelings of euphoria. However, it also depresses the respiratory system, which can be fatal in overdoses.