Well, in an ideal world you'd have a key. I'm going to assume that you don't for whatever reason.
I'm also going to assume that this is a plain vanilla locked door - no security strips blocking the jamb, no deadbolt and no MiBs with stealth pistols waiting to blow your brains out on the other side. In other words, I will tell you the two easiest ways to get your front door open if you've accidentally closed it behind you.
The Ideal Case
This will be a whole helluva lot easier if you have the right tools. If you've got your wallet and are near a 24-hour store of some description, go there are buy:
One flexible plastic three ring binder (the kind made out of one large, folded piece of plastic)
A Cheap pair of scissors
Snacks (well, if you're there already...)
Cut the mechanical part out of the binder leaving two 8 1/2 X 11 sheets of plastic. You should only need one of them, but it never hurts to have a backup. Using the scissors, cut a notch out of the long side of the center of the plastic. It should be a little wider than you think the bolt (the thing attached to your doorknob
that's holding the door closed) is. It shouldn't go more than halfway across the width of the plastic or it's be difficult to maneuver.
Now insert the plastic into the space between the door and the jamb above the bolt and slide it down so that the bolt is inside the notch you cut.
This is where things start to go sour. You're going to need to rotate the plastic 180 degrees while keeping it pressured against the bolt. Just attacking the bolt head on is actually harder - it's easier to just ease into it from the side, as it were, and you don't have to worry about your tool bending from the head on resistance from the bolt. You also want to keep one foot pushing against the bottom of the door to exploit the moment the latch gives way. The object is to push the catch back just enough so that the pressure you're applying with your foot pops the door open.
Solution for the Broke and Desperate
First off, think for a second: are you sure there's no other way in? No upstairs neighbors who can let you climb through their window and down the fire escape? No way to get to the roof for the same purpose? No open windows, hidden keys, secret passages under the hedge maze? Just checking, because this is going to suck.
You're going to need to do pretty much what I illustrated above, but with less than ideal equipment. You're also probably going to need to attempt the brute force method (attacking the bolt head on) that I said you'd want to avoid.
First thing you're going to need to do is empty your pockets (and search your surroundings) for tools. You need something long and flexible while at the same time being strong enough not to bend when it hits the bolt. You might need to cannibalize something to get in - I once used the flag of my neighbor's mailbox. Sounds wrong, I know, but practically anything (replacing a mailbox included) is cheaper than calling a locksmith. Metrocards have worked for me on occasion, as have zip ties and random bits of junk mail.
Credit cards don't work anything close to as well as Colombo makes it look, but they do work. Just slide the thing between the door and the jamb and work it until you feel the latch pop. This even works on bolts you can't attack straight on - credit cards are surprisingly flexible, but if I were you I'd use one you don't care about too much.
Taken from personal experience. My last successful break-in was approximately 15 minutes ago