Your square wave signal, therefore, has relatively slow rise and fall times, and these are important to your application.
A simple op-amp voltage follower should suffice: be careful that the input voltage range (0 to 12 V, or whatever) falls within the capability of the amplifier. To work well near 0 V, it is a good idea for the voltage power supply to the opamp to go at least a few volts negative, and it must go sufficiently positive to support the maximum output voltage.