past simple: [subject] + [past form] + (finished time)
present perfect: [subject] + have / has + [past participle]
Both forms talk about the past. The choice depends on the time. If the sentence says or means a finished time, use the past simple. If no time is said, and the event matters now, use the present perfect.
Some time words go with the past simple: yesterday, last week, in 2019, two days ago, when I was a child.
Others go with the present perfect: ever, never, just, already, yet, so far, since.
A conversation often starts with the present perfect and then moves to the past simple. The first question asks if. The next ones ask when, where and how, so the time is now fixed.
A question with when asks for a finished time, so it takes the past simple.
With a time that is not finished yet (today, this morning, this week), you can use the present perfect. When that time is over, use the past simple.
For the life of someone who has died, use the past simple: the time is finished.