In the center of the tooth, under the surface of the tooth, there is a chamber ir pocket area where contains blood supply that provides oxygen to the tooth, nerves which help tooth to sense the cold, heat, and pain, and water supply which along the blood and nerve supply keep the tooth alive.
Once this chamber is exposed due to deep carries or trauma, one feels pain on that tooth.
In this situation pulpotomy is recommended by removing the soft tissue on the tooth due to carries. Then opening and exposing the the pulp or chamber.
Cleaning and rinsing the pulp with sodium hypochlorite or other proper dental products. Drying the pulp with sterile cotton, and placing medicated material like sink oxide and eugnol or MTA.
The whole purpose of pulpotomy is to preserve the tooth for further treatment with root canal in the future or in case of children to preserve the primary tooth until the permanent tooth erupts and replaces the primary tooth.