Hello,
Well according to what you have described here your maybe having multiple issues. Your anxiety could also lead to digestive issues especially stress related. It would be better to understand if you have any diarrhoea like symptoms as well. If it is just constipation you may like to add high fibre like fruits and vegetables and keep yourself hydrated. Also exercising will help the gut problem as well as relieve your stress.
Next Steps
Meet a surgeon to rule out any other issues,
consult a dietitian
Health Tips
kindly donot self medicate it may harm you.