Saving tax while something grows is great, unless you need that cash sooner. Then it is not too helpful.
I wish there were a tax advantaged vehicle to use for setting aside money for a home.
So yes, definitely invest in tax advantaged accounts, but do so with a solid understanding of your expected financial needs as best you can model for the next 5-10 years. If you need access to that money sooner, what you'd lose on tax may be worth the flexibility of having those investments somewhere more easily liquidated.
EVERY contribution you make to a Roth IRA/401k can be pulled out, tax-free, at any time for any reason. It's the earnings you have to be careful about. But for example if you have contributed $20k to your Roth IRA or Roth 401k, and it is now worth $35k, then you can pull out $20k at any time for any reason, while for the other $15k you have to wait until 59 1/2, or use SEP withdraws, etc.
In addition, for a first-time home purchase you can pull out up to $10k without penalty (but with normal income tax applied) from a traditional IRA or 401k.