This is not a super hard rule. We prefer Past Simple when talking about the way of doing something or circumstances in which the action took place. Shortly, we are interested in the manner rather than the fact of doing something.
How did you do it?
Where did you do it?
When did you do it?
Why did you do it?
I did it because …..
When we want to stress just on the fact of doing something without an indication of circumstances, place and time when an action happened, we normally use Present Perfect (Past Simple is possible too):
She has lost her keys (She doesn’t have her keys now). Related lesson: Present Perfect and Past Simple Compared: Completed Action: Is there result in the present?
I have been to Egypt. Related lesson: Present Perfect and Past Simple Compared: Repeated habitual vs single actions
She has just returned from New York. Refer to: Present Perfect: Recent action
In a nutshell (exceptions may apply)
We use Present Perfect to say that something has happened, and we use Past Simple to say how, when and why something happened.