The correct term depends on the causality.
If doing one thing causes the other to happen, then you can talk about a consequence or side-effect. Say you are planning to wash your car and clean the drive. The car is standin in the drive as you wash the car, and you use so much water that the drive is pretty clean by the time that you have finished.
The drive was cleaned as a consequence of washing the car.
The drive was cleaned as a side-effect of washing the car.
If you didn't plan to clean the drive at all, you can also use the word unintentionally
I unintentionally cleaned the drive
If you need to do one thing in order to achieve another thing, then it's a pre-requisite or a requirement. Say tou move into a new apartment and you need to arrange an internet connection and a phone line. You go to the internet company and they tell you that you need a phone line in order to get an internet connection.
The phone line is a requirement for an internet connection.
The phone line is a pre-requisite for/of/to an internet connection.