I almost never use music (on headphones) in an outdoor activity (such as, running or mountain climbing). I prefer to concentrate on the outdoor sounds and be aware of my body. Music becomes distracting on those occasions. But when I give myself a break from running/mountaineering or when I have reached the goal, I almost always play some music. It is like a reward, because I love listening (and dancing) to music.
Sometimes I use music when I do yoga (but not always). I usually play calming music when I have had a very rough day, so the practice is more focused on relaxing myself and my body.
I am not an athlete, but before a big event I don’t listen to music on headphones. If there is a possibility, I play some music on speakers. It is usually music that does not keep your mind preoccupied with it. Background music. I avoid the headphones because with those on it is like I am entering a whole other world of mine and exclude the surrounding. When I have something big to prepare for I try to be as present in the moment (and the reality) as I can be.