Unless you're blessed with concert promoter friends, scoring a location for a gig can be harder than actually forming and rehearsing with a band. So rather than dealing with the nightmare of paying to play, or bothering every one of your acquaintances and relatives to get the meager audience required to play that hole-in-the-wall dive bar, create your own DIY venue. There, you can play as long as you like, there's no cover charge and the drinks are free (provided someone brings a few cases of beer).
Picking a suitable location requires knowing exactly what kind of space your music will benefit most from. It's also important to know which locations can tolerate your music and volume. If you play in a quiet, acoustic band, you can probably get away with playing in a house or apartment (if the neighbors don't mind a little noise). If you're playing during the day, a backyard might be the optimal spot. If you're playing with amplified instruments, you need a bigger space, like a warehouse. A large space with high ceilings will be echoey, fantastic for some genres, and inappropriate for others. Know your music and research what types of spaces benefit your sound before securing a location.
Another important facet of picking your location is the area your "venue" will be in. Again, if your band is relatively quiet (think a singer songwriter or a small jazz combo), you can get away with playing in a residential area, as long as it isn't too late, and you're not playing across from a school in session. If you're playing louder music (rock or dance music, amongst many other genres) you'll need a less populated area, like a warehouse district or a commercial area that empties out at night. Abandoned buildings can also make for great locations, potentially great for both acoustics and eerie ambiance, although the legality of their use is questionable, and the risk of getting shut down will greatly increase.
Using the right equipment in a DIY venue is important, but familiarity with your equipment is far more crucial. Don't run and borrow your friend's massive amp if you're not comfortable playing with it, no matter how big a space you need to fill. Keep the amount of variables, and the increased potential for problems that come with them, as low as possible. Play with equipment you know, since your improvised space will no doubt have sonic quirkiness of its own to deal with.
Finally, don't go it alone. Recruit some friends to help out, so you can focus on performing. Designate a "sound guy." He or she doesn't necessarily need to be a professional, but having someone who knows the equipment will make for a much smoother and improved performance, whether they're adjusting levels or just plugging the PA system back in after someone trips over the wire. And of course, assign someone to be the lookout, to alert you if the police show up, or just to check the volume from the outside.