Trouble sleeping

I’m almost 24 weeks and have really started having a lot of trouble sleeping the past couple of weeks. I have a lot of bad dreams and when I wake up from them I am wide awake. Even when I wake up just to pee it takes me forever to get back to sleep. But then as a result I’m exhausted all day. How can I be so tired during normal hours but so awake at night? Anyone else experiencing this or have advice?