Swelling is because of infection. may be your tooth is decayed or broken. you can send us the picture of your tooth and get the x-ray done also. deep cavity can be treated with root canal treatment. if tooth is not savable then is requires extraction. sometimes, in the presence of infection antibiotic is also required.