How did ancient Olympic athletes prepare for competitions?

The ancient Olympic Games (Ancient Greek: τὰ Ὀλύμπιαta Olympia) were a series of athletic competitions among representatives of city-states and were one of the Panhellenic Games of Ancient Greece