Answer
$$ y= \frac{4}{1-t}.$$
Work Step by Step
By separation of variables, we have
$$\frac{dy}{y}=\frac{dt}{1-t}$$
then by integration, we get
$$\ln y=-\ln (1-t)+\ln c=\ln\frac{c}{1-t}\Longrightarrow y= \frac{c}{1-t} .$$
Now, since $y(2)=-4$, then $c=4$.
So the general solution is given by $$ y= \frac{4}{1-t}.$$