Diet-wise, the main causes of constipation are foods too heavy to digest (meats), too drying (diuretic) or too light in properties.
Try to avoid cabbage broccoli and brussel sprouts in particular.
Make sure to put plenty of oil on your salades (cold pressed flax seed oil (= laxative) or olive oil) Flushing down some ghee with hot water on an empty stomach also helps to soften the stool (lot of good experience with that). The best spice for constipation is ginger. Lemon ginger tea is excellent, especially on an empty stomach and before meals. Spicy food in general is recommended, as it fuels the digestive fire. Black pepper is on of the best. And if you have cayennepepper or asafoetida, then go nuts.
I would not advice coffee because it is diuretic (can dry the stool) and can aggrevate your condition. It obviously works for some people like Raster says, but not for everyone.
Oh and never drink cold water. In depletes the digestive fire.