In your examples, the word "just" is being used as an adverb in the sense of "only," so it should appear immediately preceding the word or phrase to be modified. So the usage becomes more intuitive for you, it maybe be helpful to imagine a spoken accent being placed on the word or phrase that's being modified by "just" or "only." The accent is, indeed, present in the meaning, if not in the intonation.
Let's play with the accent to see how the meaning can change:
"One does not become cool by only playing football."
This implies that the speaker believes there are other things to do with football that make one cool. Perhaps you should also watch football, and study football statistics.
"One does not become cool by playing only football."
Oh? What else should he play in order to become cool? Perhaps the writer believes one also should play table tennis, or golf.
"One does not become cool only by playing football."
Here, "only" modifies the entire phrase, since it can't really modify only "by." In this case, the writer apparently believes that other activities and/or personal characteristics can make one cool.
"One does not become cool by playing football, only."
The intended meaning in this construction is unavoidably unclear, without context. It may perfectly suit a scenario where someone had just said, "Forget about all those other things, like school and hackathons and backpacking. You'll never be cool if you don't play football." The meaning is now obvious, and out of the phrases you gave, the appropriate one would be "One does not become cool only by playing football."
With the meaning that you specified, there is still some ambiguity without more context, because intonation in English is so important. Is it "Playing football does not make someone a cool person," or is it, "Playing football does not make someone a cool person."