This sounds like a large, hard stool causing a small tear at the anal opening, which is a common cause of severe pain with constipation. The laxative syrup should gradually soften the stool over a day or two, the antacid is likely for an associated acid issue, and the ointment is meant to ease local pain and help the area heal.
Next Steps
Keep taking the prescribed medicines as directed, drink plenty of water, and add fibre from fruits, vegetables and whole grains to your meals. A warm sitz bath after using the toilet can ease the pain while it heals.
Health Tips
See your doctor again if the pain worsens, the bleeding doesn't stop, or you're still unable to pass stool after a day or two on these medicines.