You can take medicine according to the cause of the burning pain in the anus when you have a bowel movement. The first thing to consider is that it is caused by hemorrhoids, which may also be red, swollen, congested and bleeding. You can take a potassium permanganate bath and then take oral medication such as fire-clearing gardenia tablets, triphala tablets or acacia pills, with anal plugs into anal hemorrhoid suppositories for treatment. If the symptoms are not relieved, surgical treatment can be performed. Secondly, the pain may be caused by anal fissure, and there will be persistent pain after stool, you can use Chinese herbal sitz bath or potassium permanganate sitz bath. Afterwards, the use of compounded keratanate suppositories in the anus can help repair the mucous membrane, which can be treated with oral lidocaine gel and other medications only. In addition, there may be an anal abscess caused by the best can go to the hospital to distinguish what is caused by the situation, and then targeted treatment.