Assalamu Alaikom all,
Abu Abdur Rahman Abudullah ibn Mas'ood narrated that the Prophet (peace be upon him) said,
"Verily the creation of each one of you brought together in his mother's womb for forty days in the form of a Nutfah (mixed drop of male and female sexual discharge), then he is an 'Alaq (clot of blood) for a like period, then a Mudghah (morsel of flesh) for a like period, then the angel is sent to him who blows the breath of life into him and who is commanded about four matters: to write his means of livelihood, his life span, his actions, and whether his end is good or bad.
By Allah, Whom there is no deity (worthy of worship) other than Him, one of you behaves like the people of Paradise until there is but an arm's length between him and it, and that he that which has been written overtakes him, so he behaves like the people of the Hellfire until he enters it. And one of you behaves like the people of Hellfire until there is but an arm's length between him and it, and that which has been written overtakes him, so he behaves like people of Paradise until he enters it." Related by Bukaree and Muslim.
Some of my thoughts on this hadith:
May Allah saves us from being of the people who behave like the people of Hellfire. Ameen. This hadith is a good reminder to be sincere and consistent in our actions, and to do perform our deeds for the sake of Allah. Some of the commentary mentioned that the people described in the first part of the hadith (ones who perform actions of Paradise till the end, when they perform actions of Hell) potentially could have been insincere about their actions, and these insincere corrupt intentions overtakes them at the end.
This hadith is definitely a bit scary, but at the same time, gives up hope, in terms of working towards receiving Allah's guidance, no matter our current state.
This hadith also reminds me not judge people, no-one knows on what type of actions will be in our end. May Allah bless us with the sincerity in our hearts. Ameen-
Be cool and take care.