Work problems are solved with rates, not times: a job done in 6 hours is 1/6 of the job per hour. Add the rates of people working together, then invert.
Turn every time into a rate first. If Ana can paint a room in 6 hours, she paints 1/6 of it each hour; if Ben takes 3 hours, he paints 1/3. Working together they paint 1/6 + 1/3 = 1/6 + 2/6 = 3/6 = 1/2 of the room per hour, so the room takes 2 hours. The trap is averaging the times: (6 + 3) / 2 = 4.5 hours is slower than Ben working alone, which cannot be right. Two people together always finish sooner than the faster one alone - a quick check that rules out wrong options before you calculate.
The same rule runs backwards and with opposing work. If Ana alone takes 10 days and Ana and Ben together take 6, Ben's rate is 1/6 - 1/10 = 5/30 - 3/30 = 2/30 = 1/15, so Ben alone takes 15 days. A pipe that fills a tank in 4 hours with a drain that empties it in 6 has a net rate of 1/4 - 1/6 = 3/12 - 2/12 = 1/12, so the tank fills in 12 hours: the drain's rate is subtracted because it undoes work.
When the problem counts workers instead of naming them, multiply to get the size of the job. Eight workers finishing in 12 days is 8 × 12 = 96 worker-days of work, so six workers need 96 / 6 = 16 days. And when it asks how much is done after some time, the answer is rate times time: a crew that needs 9 days finishes 5/9 of the job in 5 days - which is exactly the question below.