how to cure- gas collected in stomach causing severe headache?

Gas collects in stomach due to which stomach is swollen and a severe headache happens