In the end, the protagonist should save the day, solve the mystery, rescue the princess, slay the evil wizard, or whatever other heroic resolution ties up your story. Along the way, however, the road should be full of potholes (but not plot holes!), detours, and crumbling bridges.
The worse you can make life for your protagonist, the better. The more he/she has to overcome, the more heroic he will look in the end. For example, in my current work in progress (a mystery novel), my protagonist (a private investigator) got ambushed and beaten, which sent him to the hospital. Right when he thought he was being discharged, the police came and arrested him. As if that weren't bad enough, the painkillers prescribed for his cracked ribs stayed behind in the hospital pharmacy. And it might get worse for him before it gets better.
It *does* have to get better. At some point, the protagonist must overcome the obstacles (this is an active process--it should never happen via luck or someone else's direct actions) and fulfill his/her quest. You should throw other obstacles in the way as the story dictates. The protagonist should be challenged, bloodied, abused, etc because it makes the denouement that much more meaningful.
The important thing is not to have a "Mary Sue" protagonist. Someone who skates by every challenge is not a compelling character. Perfect characters are boring and easy to hate. Put sharks in the water and make sure the protagonist doesn't have any "shark repellent Bat-spray" in his/her utility belt.
Happy writing, and I hope you enjoy making your protagonist suffer.