Very, Very slowly - transitioning tablespoons per day in your mix between caf- and decaf. Give it a week or 10 days to change over to decaf, then replace decaf coffee with teas. If you get the headache, have just a little bit of caffeine, and keep working down.

or

Cold Turkey. It'll hurt bad for 2-4 days, but then you're done.

I've done both, but find I do best with just a little bit of coffee, and I enjoy it, just need to keep from over doing it. I've also found quitting sugar is by far more painful than this.

You can do it!