Home prices and rent alike have skyrocketed over the past couple of years. According to Redfin, the typical asking rent in the U.S. topped $2,000 for the first time in May.

Savvy homeowners have options to ease the financial burden of high housing costs while making money for themselves in the process.

Some may not know what house hacking is, but it's one of the best real estate investments you can make. Here is what you need to know about house hacking and what it can do for you.

House hacking has nothing to do with computers

The name implies something in technology, but house hacking is essentially the practice of renting out parts of your primary residence. Owning a multifamily home and renting out the other units is typical, but some people live in single-family homes, renting out rooms too.

Suppose you buy a two-family home for $360,000. Your basic 20% down and 30-year mortgage would come to a monthly payment of roughly $1,960. Living on one side and renting out the other for $2,000 monthly would cover your mortgage payment!

House hacking can create breathing room in your budget that can have profound financial benefits over time. Want to invest? Take that $2,000 you're saving on your mortgage and save up for another down payment on your next rental property. You can rent both sides to cover the mortgage and repeat the process as you build a real estate portfolio.

Remember, as a homeowner, your mortgage payment won't change (outside of taxes and insurance), assuming your mortgage carries a fixed rate -- your home equity increases as the property's value increases and your mortgage balance decreases. Meanwhile, rent increases over time, putting more money in your pocket.

But it's not all roses

There are drawbacks to house hacking; your tenants will be living in your building and with you if you're renting out rooms. A bad tenant can be even worse if you think a lousy neighbor could be stressful. Making sure you screen tenants carefully is crucial.

You're also potentially giving up that feeling of privacy that comes with homeownership. If you're renting out units in a multi-family home, your tenants are a knock away. Are you renting out rooms in your single-family home? You're sharing common areas like kitchens, and bathrooms, living more like a roommate than a homeowner.

Imagine how awkward it might be to chase down late rent from someone who lives with you. House hacking can be a cheat code to supercharging your wealth building, but it's something that you must go into fully understanding the drawbacks of such a living arrangement.

Alternatives if house hacking isn't for you

There are other ways to generate passive income from real estate investments. You can invest in real estate investment trusts (REITs), publicly traded companies that acquire and rent out properties, distributing most of the taxable income to shareholders as dividends.

REITs come in all shapes and sizes. You can build a diversified portfolio of REITs that exposes you to many real estate types, from retail properties to shopping malls, hospitals, warehouses, and residential properties.

Whatever you decide, real estate can be an excellent part of a diversified investment strategy. With some action, time, and patience, you can build a dividend income stream that will pay your living expenses or set you up for long-term prosperity.