The wash sale rule is important when you are selling and rebuying stocks to offset losses.