Finding out that your wife is gay can be one of the most difficult things you will ever do in a relationship. You may be tempted to avoid the topic by lying or telling her that you are straight, but this will only cause more damage in the long run. It will likely devastate her and leave her feeling angry, confused, and hurt.
You must be prepared to help her through these feelings and make a decision about what is best for you both. Depending on how she reacts, you may want to consider counseling. You can find a counselor in your area who specializes in LGBTQ+ issues. If possible, try to find a therapist who is a woman, as they might better understand your wife's reactions.
If you decide to tell her, do it face-to-face if you can, and don't rush. Let her know that you love her and have been happy together. You can work up to it and hint at it, but eventually you will have to tell her that you are gay.
Don't blame yourself if she becomes angry or upset, as this is her reaction to a lifelong secret being revealed. You may be able to work out a plan for the future of your marriage, or you may need to separate. If you decide to separate, be sure to communicate openly and honestly. If you want to stay in your marriage, consider seeing a therapist together, and don't hesitate to seek out an online therapist for couples if necessary.