Opioids are medicines that can help ease pain. They can be used to treat both acute and chronic pain that ranges from moderate to severe.