How to invest in real estate to build long-term wealth