The last step is to rule out the applicability of the "wash sale" rule.
If you bought the stock (or "substantially identical" stock) again within thirty days before or after you sold it at a loss, you are not allowed to claim the loss on the sale. The loss must be added to the purchase price of the stock you bought the second time.
Here's an example of how the "wash sale" rules work:
You bought 100 shares of IBM Corp on 4/4/2004 at $60.00 per share, for a total cost of $6,000.00. On 7/7/2007, you sold 100 shares at $50.00 per share for total sales proceeds of $5,000.00. You then repurchased 100 shares on 8/5/2007 at $70.00 per share, at a total cost of $7,000.00.
Your capital loss of $1,000.00 on the sale of 7/7/2007 is not claimable on your 2007 tax return because you bought the same shares back less than thirty days later. The disallowed loss of $1,000.00 is added to the cost of the 8/5/2007 tax lot and your adjusted cost basis for the 100 shares is now $8,000.00.
How do you actually report this on your Form 1040 Schedule D? First, you list the sales transaction as if no wash sales rule applied. Then on the next line, write the words "wash sale" and the amount of the loss as a positive number in order to back out the loss.
You cannot get around these rules by having your spouse buy it back.