Prince William has urged everyone to find people to talk to during difficult times and outlined the link between sport and mental health.