Despite the name, anyone can get athlete’s foot - not just athletes.
To prevent yourself from getting athlete’s foot, wear protective footwear like shower shoes or flip-flops when walking around a pool, gym, public shower, or locker areas as the fungus which causes athlete’s foot may be on the floor.
It’s important to keep your feet dry as the fungus is attracted to damp, warm areas like sweaty shoes - you may wish to alternate shoes each day to give them time to air and dry properly.