As-Salaam alaikum,
Sayyadina Ali Ibn Abi Talib, may Allah be pleased with him, quotes the Messenger of Allah, Sallallahu alaihi Wasallam, as having said:--

"There is none whose final abode is not known to Allah from beforehand-
whether it is going to be Hell or Heaven."
The audience said, "Should we not
then hang on to the scroll of destiny and suspend action?"

The Messenger of Allah, alaihi salaat was-salaam, stated: "No, do your part for what is pre-ordained for one has been made easy for him. If he is fortunate, the path of goodness has been smoothened for him but if he is doomed, evil deeds are equally facile to him." He then recited the ayat/verse:--

"But as for him who gives (in charity) and fears (Allah),
and accepts whatever is good, We surely will smoothen
the path the path of happiness."
(Bukhari and Muslim).