As Kitt said, you should ask your doctor or pharmacist about how to take the Carafate in conjunction with your meds. I love Carafate and it works great, but it's hard to take because of timing.
I generally take Carafate before meds. I have heard of people who set their alarm early, take the Carafate, then go back to bed. You need to take Carafate 2 hours before or 2 hours after medications. I did talk to a pharmacist who said that if I took my medication before Carafate I could space it a little closer because it doesn't take 2 hours to clear your stomach of the medication. She told me that by an hour or so the medications should be out of the stomach.
The directions for Carafate and eating are...take it one hour before or two hours after meals.
Really, it doesn't matter which you take first...just that you space them properly. Carafate can interfere with the absorption of medications if you don't allow enough time between. If you take it while food is still in your stomach it coats your food, and doesn't coat your stomach properly.
I hope you get your gastritis into control soon.
Hang in there,