"You could write that letter yesterday" shows an ability in the past. So, there's a big chance that the person already wrote that letter yesterday. "You could have written that letter yesterday" tell us that the person was supposed to have the opportunity to write the letter yesterday, but he didn't have it, so he didn't write the letter.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.