In this work, we consider the multidimensional time-fractional diffusion equation with the ψ-Hilfer derivative. This fractional derivative enables the interpolation between Riemann-Liouville and Caputo fractional derivatives and its kernel depends on an arbitrary positive monotone increasing function ψ thus encompassing several fractional derivatives in the literature. This allows us to obtain general results for different families of problems that depend on the function ψ selected. By employing techniques of Fourier, ψ-Laplace, and Mellin transforms, we obtain a solution representation in terms of convolutions involving Fox H-functions for the Cauchy problem associated with our equation. Series representations of the first fundamental solution are explicitly obtained for any dimension as well as the fractional moments of arbitrary positive order. For the one-dimensional case, we show that the series representation reduces to a Wright function and we prove that it corresponds to a probability density function for any admissible ψ. Finally, some plots of the fundamental solution are presented for particular choices of the function ψ and the order of differentiation.