You need her in your life, bu you can't be together. The best choice is for you to end any romantic feelings for her so you can stand being near her when she's in a relationship and support her without feeling any pain from doing so. It's hard, but it can be done, and I assure you, you won't regret it.
Understand that making this transition will not be easy. You love her, more than anything else in the world, and she's also something you can't have. That's something that is absolutely, incredibly agonizing. Talk with her first. tell her how you feel--you both know you can't ever be together, but that you love her. Explain to her that in order for you to ever get over her, for you to have he healthiest, most positive relationship, you have to move on--not from her, but from any chance of a romantic relationship.
Cut contact with your friend for now. This needs to happen; time away from your friend will help you make a line between your hope for what could have been, and the reality that now must be. Talk with your friends and family (but know that you need to talk more than they will likely be able to handle.) Treasure the romantic memories you had together, get everything out on paper, make a mental box of memories if you have to, and then let it all go. Treasure it, and then throw them away, accepting the fact that you no longer need to torment yourself with what-will-never-be. Take as long as you need to heal.
You can do it; I promise, even though it'll be hard, it'll be worth it to be able to stand by each other and not hurt so deeply.