Pay one’s dues

To earn one’s right to something through hard work or suffering.

The young athlete paid his dues and became a member of the best team in the city.