Given the origin of the question, I assume you might not be very familiar with how Gauss's Law works and other more advanced issues, so I'll try to explain it in a more qualitative way.
Let's consider a conductor of arbitrary shape and with a spherical cavity inside, with a charge $q$ located at its center. Since it is a conductor, charges will be induced on its inner surface in such a way that the electric field inside the conductor is zero. Think of a region very close to the cavity (but inside the conductor), meaning the influence of the electric field generated by the induced charges on the inner surface is much more relevant than the influence of the electric field generated by the charges that will be induced on the outer surface. For all purposes of calculating the electric field, only these induced charges matter, and therefore by symmetry, it's necessary for the charge distribution to be uniform, and for the total induced charge to be
$−q$, so that the field is zero. The shape of the conductor doesn't matter. Even if it has the shape of a potato, what will make the electric field zero inside it in the regions farther from the cavity is precisely the density of charges on its outer surface, which might not necessarily be uniform, but close to the cavity the only importance is on the charge and the inner surface.