Well, you can try and write an offer that is subject to your home selling, but I wouldn't count on the seller accepting that.
Much will depend on how active real estate is in your area.
Have you discussed this with a Realtor?
if not, I suggest you find a local agent and come up with a realistic plan .
You will need to be pre-approved for a loan, so you need to speak to a lender.........that pre approval may very well be subject to your home selling first.
Bottom line is....get your home on the market, and get it sold.....if you need to sell first, you need to sell first!