Your sentence is almost there. You've got the right idea! Here's how you can improve it:
"I've been tossing and turning all night because I drank a lot of coffee this morning."
Breaking it down:
So, the corrected sentence better matches natural English phrasing while conveying the same idea: that your coffee consumption earlier in the day resulted in difficulty sleeping at night. Keep practicing and refining your sentences - great job on expressing yourself clearly!