It's almost impossible to do business of any kind without consulting an attorney, but when is the right time for an entrepreneur to get one? And what kind of attorney is right for you?
You can do some initial "digging around" about your market, target industry, competitive landscape and the like first. If at first blush you think your idea could be viable, then your next step should be getting an attorney. Because the NEXT thing you're going to do is start talking to people about your idea and getting people on your team.
Anytime you want to get someone involved, whether in exchange for equity or taking cash or some other arrangement, you need an attorney to cover all of the what-ifs for you. They are (by nature) worst-case-scenario thinkers, but that's exactly what you need. Let your attorney handle the what-ifs while you focus on keeping the excitement and fanning the flame of your idea.
Your attorney MUST have experience doing business-related documents (corporate structures, partnership agreements, etc) and SHOULD have experience working with new and budding entrepreneurs if possible.
Bonus points: Some attorneys are sensitive to the realities of a new business venture and will let you float your bills for a bit while you get going. Even bigger bonus points if they'll take a little equity in exchange for being your attorney-on-call.