Use Past simple when:
You say when it happened (yesterday, in 1945, last week)
It's finished (The team won the match)
Use present perfect:
You don't say when (I've been to China, I haven't seen that movie)
It's not finished (We've been friends for 6 years)
It happened extremely recently (That tree has just fallen over, He's just arrived)
This website has grammar explanations and exercises: https://www.perfect-english-grammar.com/
This page is for past simple versus present perfect: https://www.perfect-english-grammar.com/present-perfect-or-past-simple.html