Dentists removes the inflamed pulp. Then they clean and disinfect the inside of your tooth and place a filling on your tooth to seal the space.
For more information, check out https://my.clevelandclinic.org/health/treatments/21759-root-canal