When making a shepherd's pie, let the mashed potatoes cool completely before adding them on top of the filling. When you let it cool, it forms a firmer barrier.