You can do both simultaneously or opt to complete your ground school before starting your flight training.
Becoming a private pilot entails undergoing ground and flight school. You can do both simultaneously or opt to complete your ground school before starting your flight training.