A wash sale happens when you sell an investment at a loss and buy substantially identical shares within a 61-day window: 30 days before the sale, the day of, and 30 days after. When that happens, the IRS disallows the loss for now. It is not gone; it gets added to the cost basis of the new shares and can be claimed when those are eventually sold. But you cannot use it this year.
Example: you sell 100 shares of a fund at a $4,000 loss on March 1 and buy 100 shares of the same fund on March 20. The $4,000 loss is disallowed. Your new shares carry a basis $4,000 higher than what you paid for them.
The rule catches people in ways they do not expect. Buying the same stock in an IRA counts. A spouse buying it counts. Dividend reinvestment that buys a few shares automatically counts. And for people with equity compensation, an RSU vest or ESPP purchase of company stock within 30 days of selling company stock at a loss counts too, which can quietly undo tax-loss harvesting on a concentrated position.
The common mistake is harvesting a loss in December and letting a scheduled vest or purchase land in January. Before selling company stock at a loss, check the next vest date. If it is inside the window, either wait or accept that the loss will be deferred rather than used now.