feeling the urge to go poo

I have the urge to go poo but then as soon as I get to the bathroom I can't go.. what can I do about this constipation.