Tax-Loss Harvesting: How It Works, When to Use It, and Key Rules