Coffee cold turkey is devastating. It is recommended that you track your daily "average" starting consumption, and then over the course of several week/days, slowly lower your total caffeine intake. So for example 200mg > 180mg > 150mg > 100mg > 80mg > 50mg > 20mg > 0 mg, or whichever system will work best for you.
Replacing coffee with green and black teas is also a very good idea, though most importantly, KEEP DRINKING A LOT OF WATER. If you are not hydrated, you will get more/worse headaches, and you will feel more lethargic/ in a brain fog.