Avoid eating foods that cause gas several hours before you anticipate having sex. [The National Institutes of Health offers a comprehensive list of foods that cause gas.] Go to the toilet before bed and see if you can eliminate gas or possibly stool. And relax. Don’t occupy your mind with this worry, or you really won’t enjoy the sex.