Hello and thank you for using JustAnswer Health.
The best solution is to let go of the situation. You have already taken the coffee so there is nothing you can do about it. So instead, enjoy your time awake by reading or doing something purposeful with your time (if that makes you feel better). Write a list of things you want to achieve this week, or simply journal about your feelings and frustration. This can work wonders to relieve pent up anger and anxiety. Just be sure not to beat your self up. You made a mistake, and focus on what you can do now that is positive. Warm milk makes some sleepy (depends on if you tolerate it) or chamomile tea can help.
Some people are very sensitive to the effects of caffeine and cannot drink it at all due to insomnia. Others do fine by having there last amount by 12pm or 6pm.
There are many things you can do to regulate your sleep. This article will explain many of them: http://www.helpguide.org/life/insomnia_treatment.htm
The same website also have very good sections on stress relief and anxiety relief and other topics. Taking slow deep breaths and focusing on positive subjects such what ever you find relaxing (walking on the beach with the sun going down) or other topics can be helpful as well.
Many people don't realize the alcohol is disruptive of sleep too - it may initially help one get to sleep, but typically the sleep is of a light nature and one will wake up in a few hours.
Reply to this post if you have questions or need clarification so that we can assist you until you are satisfied with your answer.