It is important to distinguish whether the anal swelling and pain is caused by a hemorrhoid attack or by a perianal abscess attack. If the swelling and pain is caused by hemorrhoids, conservative treatment methods can be used. First, you can take an anal sitz bath with warm boiled water to relieve pain and also reduce anal edema. Next, in the swollen and painful area, locally apply hemorrhoid-type ointment, such as anal tide ointment, Ma Yinglong hemorrhoid cream, etc. If the anal pain is unbearable, diclofenac sodium suppositories can be incorporated in the anus for pain relief. If the stool is dry, you also need to soften the stool, you can take oral hemp pills, Sophora pills, lactulose oral solution, etc. for laxative. If a perianal abscess causes swelling and pain, conservative treatment methods are not effective and surgery is needed to cure it.