If you got a good education on personal finance while you were growing up, you might think that all loans are bad. For personal budgeting, you shouldn’t spend money you don’t have because that means extra interest payments and less money to pay your bills later on. When it comes to business, a loan can actually help you make money.

Let’s look at simple math. If you put a $1,000 vacation on a credit card charging 15% interest, you’re paying an extra $150 every year until you pay off the balance. Business interest works the same way, but it’s not the only part of the math equation. You might be buying a $1,000 piece of equipment that can help you make $10,000 in sales in just the first year. You’ve still spent $150 in interest, but you’ve come out much farther ahead than if you hadn’t borrowed money.

In business, loans should be seen as an investment. You’re spending money now with the hope of turning it into much more money. As long as you expect to make more than the loan plus interest, it’s profitable to take out a business loan.

The trick is that investing is risky. Your business may not always go according to plan. Maybe you don’t get the sales you were expecting after you invest in a marketing campaign or selling a new product. In those situations, you’ll still have to repay the business loan and pay interest on the loan. That’s why some people will still tell you not to take out a business loan from companies like OnDeck capital. They have a valid point, but they’re not entirely correct. Nearly every successful business has gotten funding to grow from some type of investment.

If you want a business loan to help you, you need to be smart about the loans you take out. You should always have a specific plan for any money you borrow instead of just borrowing money to have more cash. Your plan should include how you plan to spend every cent and what you expect it to do for your business. You should also project how your sales and profits will increase so that you can see if your investment will make you money like you’re expecting. You should also plan for a bad outcome where your project isn’t as successful as you had hoped. If you don’t overextend yourself with loans, you’ll still be financially secure if one investment doesn’t work, and your successful investments will still mean you’ll be coming out ahead