Most people think that it is a good thing to be optimistic in your business endeavors. But in truth, optimism is your worst enemy. Be realistic, not optimistic. Optimism will cause you to overlook potential problems. Pessimism is your friend.
Before you embark on an endeavor (such as purchasing a property to rehab) make a list of everything that could possibly go wrong. Then ask other knowledgeable people to add their ideas to that list. Develop a plan for mitigating each of those potential problems. Estimate your profit for each or these scenarios. Do you still make your goal profit (i.e. $30K) if A, B and C happens and it becomes necessary to implement mitigation plans X,Y and Z?
When I worked as a project leader on engineering jobs, this is the sort of project planning I was trained to do. This was the company's formal process. After creating the project plan, I had to defend it in front of a commitee of intelligent, experienced and cynical people. It's a good process. It actually works pretty well. It eliminates the optimistic bias that seems to be part of most humans' core makeup.
People made fun of Donald Rumsfeld when he spoke about the "unknown unknowns". This was, not surprisingly, too much intellectual complexity for most of the American public. But this is something that people who plan big projects with a formal process are very familiar with. It's an important concept for smaller projects as well.
For example, if you are considering buying a single family home and you know that the furnace may be a problem but you're not sure if you would need to replace it or not, that is a "known unknown". But what if there was mold somewhere hidden and you had no idea that it was there until after you bought the house and did some demolition? Then that mold was, prior to the purchase, an "unknown unknown". The moral of the story is, have enough buffer in your budget and schedule for the unknown unknowns.
So once you've created your plan, including all the things that could go wrong, the probability of each problem and the mitigation plan for each problem, then in your head take on the role of those cynical commitee members reviewing the plan. Pretend that you are on the outside, looking in at the plan and trying to find the holes. Act as your own critic. Make a list of the holes in the plan. Then go fix those holes. If you can't fix them to the satisfaction of your inner critic, abandon that deal and go find another.
You should probably reject about 85% of the deals you consider. Only accept the deals where, even if most of the problems on your list actually occured, you would still make a decent profit. Only do the "can't lose" deals.
Rehab budgets are almost always overrun. Schedules are almost always blown. But if you are pessimistic in your planning, you may not blow out your budget and schedule too too horribly.
There is the opposite problem as well. Over-pessimism can cause you to be afraid to act. It's just that in my experience over-optimism is hugely more prevalent in our society than over pessimism.