Thank you for asking question on health care magic
this swelling may be a prolapsed rectum
or a peri anal abscess
it needs antibiotics and pain relieving drugs for temporary relief.
surgical consultation is a must
Hope this answer will serve your purpose
Associate professor of pediatrics