I found all of this out last Sunday night
Since this just happened, you have a long road ahead of you. You don't have to decide right now what you want to do about your marriage.
Don't be in a hurry to make decisions - you will probably go through a roller-coaster of emotions, repeatedly, after the shock wears off. You have the right to change your mind about what you want to do or don't want to do. You don't have to decide anything right now.
While it is true that your marriage might not have been in the best of shape leading up to the affair, cheating is not an automatic response to trouble in a marriage. That's a choice she made INSTEAD OF working with you to make your marriage better. You are partially responsible for the state of your marriage, but she is 100% responsible for her decision to cheat on you.
Your wife has poor conflict resolution skills, poor boundaries, and poor judgment. She might need to go into counseling herself to work through her own issues, as well as marriage counseling with you.
Whatever she might say now, she chose your best friend for this. Sure, he might have been "convenient" but she knew that having sex with your best friend would hurt you MORE than if she'd had an affair with someone you didn't know. Consider why she would want to compound the pain of an affair by having it with your best friend - why did she want to hurt you that
bad? Or, why didn't she care how much more it would hurt you?
Do you have children? Send them away to the grandparents for a while when you get to the point that your shock wears off and your anger hits. Or send them to summer camp or something. This will be a very difficult time for you and your wife and it might be best to shield them from the raw pain and anguish.
You can get through this, but you are in no place to make decisions about forgiveness right now. It's a common reaction for the BS to want to "save" the marriage when they first hear of the affair; don't feel bad about yourself if you find that you change your mind about that or see that you really just can't live with it.
Good luck to you.