The drain pipe can drain (1/2) of the tank in 1 hour.
The fill pipe can fill (1/6) of the tank in 1 hour.
Working together, the pipes will drain the tank in (1/2) - (1/6) hours.
(1/2) - (1/6) = (3/6) -(1/6) = (2/6) or (1/3) of an hour.
So, working together, it will take 3 hours.