Investing like Warren Buffett can pay off when the stock market is panicking.