That morning cup of coffee or early afternoon soda is probably OK. But more than 400 milligrams of caffeine a day, or more than about four cups of coffee, can cause insomnia, restlessness, headaches and other problems. Start paying attention to how much caffeine you're getting from foods and beverages. Check labels. If you decide to cut back, do it gradually. For example, drink a smaller cup of coffee each day. This will help your body get used to the lower levels of caffeine and lessen potential withdrawal effects.