A miner is trapped in a mine containing 3 doors. The first door leads to a tunnel that will take him to safety after 3 hours of travel. The second door leads to a tunnel that will return him to the mine after 5 hours of travel. The third door leads to a tunnel that will return him to the mine after 7 hours. If we assume that the miner is at all times equally likely to choose any one of doors, what is the expected length of time until he reaches safety?
I did it normally but I have been asked to solve through moment generating function. I don't know how to proceed

If you have a random variable $T$ with moment generating function $M_T(s) = \mathbb{E}[e^{Ts}]$, then its moments can be recovered by $\mathbb{E}[T^k] = M_T^{(k)}(0)$ (where this is the $k$th derivative). So if you want to compute the expected length of time using the MGF, you can compute the MGF, take the first derivative, and sub in zero. (This is probably a bit more complicated than it needs to be given that you can compute the expected value quite easily, as you have done.)