Are you constipated? If so, you need to drink plenty of water, eat fruits and vegetables, and maybe even try a fiber supplement (pills or the powder you put in water). That should help.
If you use laxatives or stool softeners, don't use them for more than a few days (read the package for how long exactly). You can become dependent on them and make the problem worse.
Are you on any medication? Some meds can cause constipation, so check with your doctor or pharmacist.
If the problem persists even with the suggestions above, you probably should see your doctor. You don't want to tear something (called an anal fissure) and start bleeding when you go to the bathroom.