What is the treatment for pulpitis?

Depends. Pulpitis means inflammation of the tooth pulp (nerve) causing tooth to hurt. It can be reversible or irreversible. Reversible pulpitis can be eliminated by removing the cause. Adjusting a new filling/crown that is too high or wearing a night guard to prevent grinding will stop pulpitis. Irreversible pulpitis is when the pulp is too sick to heal itself and a root canal or extraction is required.
Depends on whether. It is reversible or irreversible pulpitis. The former can often be relieved with an occlusal adjustment / palliative treatment. The latter required endodontic therapy (root canal therapy).