How to connect the transistor if I have to use it before the load?
One of these configurations may work for you. First is inverting and operates essentially like an open collector output with a pull up resistor. The second is non inverting. Tune the resistors to fit your needs and transistor.



simulate this circuit &ndash; Schematic created using CircuitLab



simulate this circuit