It's good you're practicing this now.
Before my first marathon, I went to a park with a half mile paved loop, set up a table and some paper cups, and ran laps. My initial attempts went much like yours.
Based on a tip I read here on LRC, I cut a plastic drinking straw in half and stuck it in my pocket. When I approached the table, I pulled it out, inserted it in the cup, pinched the paper cup shut around the straw, and drank. Success - or at least I thought so until I came around for the next lap. I reached for the straw, but it had bounced out of my pocket. I reached for the backup straw in the other pocket, and it had also disappeared. You can try it if you want, but I nixed the straw idea. It was too fiddly and took too much fine motor skill, which is not something you can count on in a marathon, especially if it's a cold morning. And you absolutely do not want to rely on your straw not getting lost for hydration.
So I went with the classic: Approach the water stop, grab the cup, pinch the top shut to form a funnel at one end, and tip the cup into your mouth. I could usually swallow 1-2 ounces/30-60 ml of water this way.
Make sure to keep practicing. If you run any smaller races, force yourself to use them as opportunities to drink at race pace.
As far as when and what to drink in a race, that gets into all the complications of marathon nutrition. I went with drinking only water at every stop (about every 3-4 km) and using gels for fuel, but definitely practice that too. Dumping unfamiliar carbohydrates in your gut during a race can have unexpected and unpleasant consequences.