Let's take Microsoft (NASDAQ: MSFT) and Amazon (NASDAQ: AMZN) as examples. If you have to sell stocks to cover an expense, you could find yourself taking a loss on your initial investment or making a profit and owing capital gains taxes. However, with today's economic environment -- high inflation and a potential recession -- it's better to aim for six months to a year's worth of expenses saved.