Help!!!

My son is 9 months and I’m having a hard time weaning him off the bottle during the night when he sleeps. His doctor told me to give him water out of a cup (like I drink) and stop giving him formula but it’s easier said than done smh. Any tips on how to get him to drink water?