Assuming it’s from congestion you can go into your smallest bathroom, close the door, run the hot water and let the room steam up. I usually do this in the morning, and after a few minutes I turn down the shower temp and take my shower while the room is still steamy. No reason you can’t do this at night too. It helps loosen the phlegm and cough up the crap, which should help stop coughing in the end, but I wouldn’t do it immediately before bed time.
Things that soothe your throat will help with the tickle that can cause you to cough. Warm tea, and some of the other suggestions above.
If you move a lot in your sleep, or get up to owe in the middle of the night, your doomed to get coughing jags too if you have an illness that involves a cough. Sucks.
Try to sleep with your head up, lots of pillows in an almost sitting position if you can.
My recommendation is Robitussin DM for night time. It’s a drug, but if you don’t have any contraindications for taking it, it’s worth calming your cough for sleep and to give your muscles in your chest a test.
A dry cough is a different thing altogether