Kindly refer to the following link(s):
Must I know the reward for an act before doing it to get rewarded?
Performing good deeds without a specific intention
What does 'Doing for the sake of Allah' mean?
Also see: https://assimalhakeem.freshdesk.com/a/solutions/articles/31000159423