To prevent the custard from curdling, temper the eggs properly. Slowly whisk in a small amount of hot milk before adding the eggs to the pan. This gradual approach helps the eggs cook gently without scrambling.