You would use a solenoid or other electrically operated valve, like a torque motor operated one, only if you must use it remotely and it isn't practical to operate it mechanically.
In doing so you also have to provide redundancy in the form of a manual override (such as a cable you can operate that forces the valve open following an electrical failure in the valve or upstream of it, or a sticking solenoid), or dual valves in parallel (or whatever else you can design to eliminate safety-critical single-points-of-failure).
Solenoids like to stick and torque motors like to burn out, and even if the valve is spring loaded to be normally open so it is fail-passive in theory, I wouldn't trust my life to it without some form of backup.
In a light aircraft design where the components can be made to be easily in reach of the pilot, a manually operated selector valve, or manually operated shutoff valves at the wing roots is the way to go. There is simply no point in designing an electrically operated system when a simple and robust manual alternative is easily done.
My preferred design would be a left-right-both selector right at the collector tank entrance, a separate emergency shutoff valve at the firewall operated by its own remote mechanical control that sticks out and gets in the way of things when at OFF, and ideally, manually operated emergency shutoff valves at the tank outlets in each wing so that fuel is contained within the wing if it gets broken off in a crash (that may be overkill - I've never seen shutoff valves right at fuel tanks in light aircraft, but I'd do it if it was my own design).