Nocturia or better known as frequent urination at night is a common cause of insomnia. There are medical disorders that can be causing this which include benign prostatic type hyperplasia or diabetes. Taking better control of these health problems can help improve frequent urination at night.
There are medications that can also contribute to frequent urination at night, such as Lasix, which is just a medication commonly used to treat hypertension. Another frequent cause of nighttime urination does include, drinking right before bedtime. This includes substances like alcohol which will wake you up in the middle of the night after fragmented sleep after you've metabolized the alcohol, or even water or other liquids can cause you to wake up in the middle of the night to use the bathroom.
So if that is a problem for you, it is important to avoid any liquids starting two or three hours before bedtime so you are not waking up in the middle of the night having to use the bathroom.