I posted something similar to this before , but this time I`m adding more detail. Please , any help is appreciated , I`m on the verge of committing suicide
Anxiety can be a huge cause of gas. Especially social anxiety. It could also be IBS or some sort of food allergy. What i would suggest is to go see an allergy specialist and see if you have any allergies you are unaware of. The body is constantly changing, so something you ate everyday for years, you could be, all of a sudden allergic to it now.
Go to your primary care doctor and ask them to do an IBD panel. This wont tell you for sure what is wrong, but it will let you know if IBS is a possible cause.
Next, see a therapist to help you with your anxiety. I assume that you are in school. A lot of schools have therapists on staff. I'd see if this is true for your school. If not, find a psycologist nearby and start seeing them. Once you are able to lessen the social anxiety, it will have a huge impact on the gas problem you experience.
Above all else, do not kill yourself. We all have tough times in life that we have to go through. It may not be easy, but it can be survived.