well, it depends on what you want to say.
Let me try to explain.
Your friend bought called a boy whom she is into. She COULD have written a letter to him.
So you use COULD + have + pp main verb because it describes an hipothetical sitatuation which you WISH it had happen but it didn'.t
In a restaurant, you need a fork.
You call the waiter and ask him "Could you please bring me another fork?"
You use COULD in this situation for making requests politly.
I am kinda sleepy so I cant figure any other example into my sleepy tired mind.
I hope I helped you.