The answers to your question are here, please read them in full:
It says in the Reliance of the Traveller:
“f1.5 No one has an excuse to delay the prayer beyond its time except:
(1) someone asleep (N: when its time first came who remained so until the time ended);
(2) someone who forgot it;
(3) or someone who delayed it to combine two prayers during a journey (dis: f15.12).“
The above being said, it is not permissible to intend missing an obligatory prayer, so even if you need to stay awake until 4 am because of work, study or so, know that many men before you have slept late and still have been able to get up and pray on time. It truly is a gift, as you will see from the links above, and a true favour from Allah to help His servant pray on time. As for staying up until 4 am for no good reason, that is absurd and potentially sinful if you know that you will miss Fajr.
I recommend reading this Qu’ranic supplication daily and please apply the tips in the link:
رَبِّ اجْعَلْنِي مُقِيمَ الصَّلَاةِ وَمِنْ ذُرِّيَّتِي رَبَّنَا وَتَقَبَّلْ دُعَاءِ
“My Lord, make me steadfast in Salāt, and my offspring as well. And, Our Lord, accept my supplication.” [Qur’an 14:140] May Allah give us and our children ease in establishing all of our prayers.
[Ustadha] Shazia Ahmad
Checked and Approved by Shaykh Faraz Rabbani
Ustadha Shazia Ahmad lived in Damascus, Syria for two years where she studied aqidah, fiqh, tajweed, tafseer, and Arabic. She then attended the University of Texas at Austin, where she completed her Masters in Arabic. Afterward, she moved to Amman, Jordan where she studied fiqh, Arabic, and other sciences. She recently moved back to Mississauga, Canada, where she lives with her family.