There is no surefire way to get around the inherent risk in startup investing. Many companies fail completely or just never make it to the next step needed to grow into a sustainable business. This being said, many people suggest diversification by spreading out your investment dollars over more companies and investing less in each one as a strategy to avoid the likelihood of loss. It can also make sense to focus on markets and technologies you know a lot about and are passionate about over those that you don’t understand as well.
Keep in mind that even professional investors have a difficult time predicting exactly how startups will earn money in the future. You should only invest however much money you are prepared to lose entirely.