That will depend on the market. Right now, we are facing a seller’s market. It means it is very difficult to buy a home. I normally recommend to my clients to buy first, so that we are certain they have found a place they love and can afford, before selling, because we know in this market houses are selling within 24 hours.
In some cases, it makes sense to sell first before buying.
For a more thorough answer, I would need to know more about your property before I can give you a proper recommendation.