This is so much the key. At college I read a sports psychology textbook which described the empirical profile of a "winner". One of the traits was that winners compete against themselves, not others. A marathoner's goal should be to beat their best time in their next competitive marathon. An example of a basketball player's goal might be to improve their free throw percentage over the next 5 games.
If you focus on improving yourself, beating other people takes care of itself (if you're capable and that sort of thing matters to you). But, either way, you do the best you can and that's all anyone can ask of themselves.