Understand the wash-sale rule through replacement purchases, substantially identical securities, basis adjustments, timing windows, and records.