I'm going to go against the flow.
I'd advise taking time to think about how you feel and what you want.
Then talking to a trained counsellor. If you decide to try and get through this together, see a good (really good, Tavistock good) counsellor together. If you decide to split, go on your own.
People have affairs for all sorts of reasons. They affect people/marriages in different ways. Only you, ultimately, can work out what you want and need now and in the future.
I'm only stating this because you might be one of the women who decides she wants the marriage to continue - and I wouldn't want you to feel bad if that's how you feel.
Equally, if you want to end it - it's your choice.
An important thing for you is that whatever you do, it should be your choice. By concealing the truth, your husband and your friend limited your autonomy, and your ability to make free choices. It's really important for you to feel and know that you have choices, you have power. You do.
I've known people recover their marriages from this. It took a lot of work and commitment. I've also known people to end their marriages and to be really happy. Both scenarios can work.
And lastly: you've had a really rough time. You're a good person, you don't deserve any of this. You're also a strong and loveable person, who will persist through this, bringing love to herself and those around her. In the short term, you do sound as though you could do with a bit of TLC, make sure you give it to yourself if you can't find anyone else to take care of you. Good luck.