How to control a 9v solenoid valve with a relay?

What to buy depends on for example relay coil current & voltage. Those will help you determine which transistor to drive your relay with. What relay exactly? Next, many visitors are calling a complete relay module just a relay. A Relay Module looks like this, some have a single relay and some multiple relays. Modules like this come in a variety of voltages as to relay coils. Next these are plain relays and like the complete modules come in assorted coil voltages. The latter require a flyback diode. In the forum General Electronics section I suggest you read a little about Flyback Diodes and why you need them.

Now what exactly do you have and what are you trying to do?

Ron