Pain is an unpleasant sensory and emotional experience we feel when we hurt ourselves. When we cut our finger, the nociceptors (pain receptors) in our finger are activated and our nervous system transmits that signal to the brain.
Therefore, the sensation of pain is actually generated in our brain, though we experience it in a specific part of your body. The sensation of being “hurt” when we cut our finger is happening in the part of our brain mapped to our finger. This is why when we sleep, we do not feel pain. This is why anesthetic works. In other words, if we halt the transmission of electrical signals through your neurons at your finger to that specific part of the brain, you would not feel pain at all. Have you heard of Ibruopfen or Tylenol (Acetaminophen)? Those are the off-the-shelf painkillers we can get at the nearby drugstore and they operate exactly on this premise. Prostaglandin is a chemical released by injured or damaged cells. Nerve endings pick it up and respond to it, transmitting a signal to your brain and consequently, you feel pain. A painkiller like Ibuprofen, blocks the release of prostaglandin by inhibiting the enzyme COX (cyclo-oxygenase enzyme) responsible for synthesising it. Reducing the amount of that chemical reduces the signal and level of pain felt. (side note: different painkillers work differently.)