When a person wakes up in the middle of the night, only to go back to sleep again, and they remember Allah at this time, their du’a will be accepted.
The Prophet, peace be upon him, stated:
“Whoever wakes up at night, and says, ‘La ilaha illa Allah Wahadu la sharika lah, lahu al-mulk wa lahu al-hamd wa huwa ala kulli shay’in Qadir. Alhamdu lillah wa Subhan Allah, wa la ilaha illa Allah, wa Allahu akbar, wa la hawla wa la quwatta illa bi Allah’, and then says, ‘O Allah, forgive me!’ or makes a du’a, then he will be responded to. And if he performs wudu and prays, then his prayer will be accepted.” (Recorded in al-Bukhari)