One way of approaching "working together problems" is to use the basic equation
$$ \text{distance} \; = \; \text{(rate)}\times \text{(time)} $$
where "distance" represents the work accomplished by working at a certain "rate" throughout a certain period of "time".
Let $r_C$ and $r_A$ be the rates at which the carpenter and assistant work, in units of job/day. The carpenter worked alone for $10$ days. Therefore, the amount of work the carpenter accomplished during these $10$ days (i.e. the "distance" the carpenter traveled in $10$ days) is
$$ \text{distance} \; = \; \text{(rate)}\times \text{(time)} \; = \; (r_C)(10) \; = \; 10r_C $$
Note that $10r_C$ is a certain "number of jobs", that number being less than $1.$ Therefore, the "number of jobs" (again, a number that is less than $1)$ that remains to be accomplished after these $10$ days of work by the carpenter is $1 - 10r_C$ (i.e. $1$ job $-$ $10r_C$ job). Since we are told that this remaining "number of jobs" can be accomplished by the carpenter and assistant working together for a total of $6$ days (i.e. when the work is performed at the rate of $r_C + r_A$ job/hour for a total of $6$ days), then using (distance) = (rate)(time) we get
$$ 1 - 10r_C \; = \; (r_C + r_A)(6) $$
We are given that the assistant can complete the entire job in $30$ days, so $r_A$ equals $\frac{1}{30}$ jobs/day. If this last observation is not clear, then use (distance) = (rate)(time) again: We have $(1 \, \text{job}) = (r_A \; \text{jobs/day})(30 \; \text{days}),$ which when solved for $r_A$ gives $r_A = \frac{1}{30}.$
Plugging this numerical value of $r_A$ into the last displayed equation gives
$$ 1 - 10r_C \; = \; \left(r_C + \frac{1}{30}\right)(6) $$
$$ 1 - 10r_C \; = \; 6r_C + \frac{6}{30} $$
$$ 1 - \frac{6}{30} \; = \; 6r_C + 10r_C $$
$$ 1 - \frac{1}{5} \; = \; 16r_C $$
$$ \frac{4}{5} \; = \; 16r_C $$
$$ r_C \; = \; \frac{4}{5} \cdot \frac{1}{16} \; = \; \frac{1}{5} \cdot \frac{1}{4} \; = \; \frac{1}{20} $$
Therefore, the carpenter works at a rate of $\frac{1}{20}$ jobs per day, so it will take the carpenter $20$ days to complete the job working alone. If this final result is not clear from "works at a rate of $\frac{1}{20}$ jobs per day", then use (distance) = (rate)(time) again: We have (1 job) = $\left(\frac{1}{20} \, \text{job/day}\right)(t \, \text{days}),$ which when solved for $t$ gives $t = 20.$
There are quicker ways of getting the answer to this particular problem, but I've found this method to be useful when you don't immediately see what to do, namely the method of taking things step-by-step using the (distance) = (rate)(time) equation whenever appropriate (i.e. whenever for a certain situation you know two of the three unknowns "distance", "rate", "time").