Best Bet: PUT IT IN WRITING!
Although this may not be a complete safe-guard against some future injustice resulting from founder disagreement, it will certainly be a strong indication of the rights of each party (meaning you and your co-founder(s)).
The biggest mistake people make is exactly what you explained. They start developing an idea or product/service without considering it actually being successful. Next thing you know, the person who came up with the brilliant solution is sharing the profits with some other guy who was just there for the ride. Any type of written agreement signed between you and your co-founders will at least provide some way to determine who owns what if a later dispute was to come about.
Besides putting this type of thing in writing, you should definitely consult with a lawyer. If your “idea” is already some sort of entity, such as a Corp or LLC, or you are considering this process, hiring a lawyer is basically essential. Yeah, a smart founder can get by doing these things on their own, but there are many things that can be overlooked. Such things include the ownership disputes that could potentially arise, and neglecting to anticipate these could cause some serious injustice.
Not only should the company consider getting legal representation, it would be wise to consult a lawyer personally as well. From the sound of it, it seems like you are concerned about your partner reaping the rewards of your input. Your rights and protections can depend on a number of different things, and a good business lawyer can help you understand your business relationship with your partner and the legal implications of such.
You should take a look at our site. Our site helps startups find the best lawyer for their business needs at the lowest possible cost. A large part of your legal work can be done through our service, saving you time, effort and money in the long run.
You can never be too safe in situations like this. Although at the beginning, success seems far away, mistakes in the early stages could come back to haunt you. Covering yourself is really the only solution to your problem.
I hope this answer helps you out. Unfortunately, there are never really black and white answers to legal questions like these, and this can be frustrating. But if your idea is something that is worth pursuing in your own opinion, you should definitely think about these things. Best of luck and please reach out if there is anything else I can do to help!