Coffee is an stimulant, I think you better stop it. Always sleep on time.At the same time take cool milk, good for the stomach or yogurt, it will clear your symptoms.Make a timetable for sleeping and eating and adhere to it.
I will recommend green tea for you+yogurt+fixed eating/ sleeping time.
You are experiencing gastritis
too with that coffee.