Hi.
Thanks for your query, albeit short and specific.
Noted the history and understood your concerns.
Blood in feces, painful defecation, swelling around anus are all indicative of a condition called fissure-in-ano.
I would advise you the following:
Sitz bath in a tub with warm water for soothing and reducing the congestion and pain.
Painkiller like
Ibuprofen as it has anti-inflammatory action too.
Laxatives to have soft stools.
Consult a General surgeon for clinical examination, per-rectal digital examination only if the pain can allow.
Get a prescription for an antibiotic,
metronidazole for 5 days.
Control of stress and
anxiety is very important.
If the pain is too much take a
bed rest and do not attempt any activities at all.
Have normal diet that you know suits you the best with high fiber contents.
All these measures will help you to have a proper relaxation and healing.