very simple-
1) budget for some upgrades. set aside some income to spend on upgrades.
2) buy desirable, easy saleable system components. if you buy well reviewed, well liked system pieces they will be easy to sell and have better re-sale value.
3) take good care of your system in case you want to sell / upgrade.
Fourteen years ago I had a mint vintage Marantz receiver and Focal bookshelf speakers and a Yamaha CD player. All were super easy to sell and for good money. Next steps were a NAD amp, Marantz CD player and PSB tower speakers. Fast forward and now I am set at everything but speakers but really close with them.