It depends on if you plan on staying in the area for long term. If you’re going to be there for over 5-7 years, buy it. There are things that suck from purchasing a home, but if you’re staying in the same area for a while, it’s better to buy. Even if prices go down, you can ride it out. If you lose your job and have to move suddenly, look to rent the place.
When I buy, I have always purchased something reasonable where I can easily rent.
I think of buying a house is part of my investment portfolio and with any investments, there will be risks but usually, if you look at it in long term, it will work out.