Steps and to buying a house?

Yall, I’m lost. What ducks and “must haves” need to be in a row before buying a house?

If I’m not set on staying in this city for more than 5 years, is it worth it?

Looking forward to hearing everyone’s thought process. In my 20s and just wanting to know what to plan for. Thanks!