Losing a friend is never easy, I can't assure you that your friend will want to be friends again but i can help. While writing your letter don't say things like "well I only did because this person told me to", take full responsibilities for your actions and apologize for what you did. Talk about how you regret the mistake you made and ask for forgiveness. Be honest and say how you feel. Give your friend time to think and don't force them to be how close you were before the incident. Good luck with your friend. You can comment if you need additional help.