Making custard is a pretty simple thing in theory. Whisk sugar and eggs together, stir in hot milk or cream, and simmer the mixture until it thickens. In practice every step must be carried off with a light hand and close attention to temperature control. If the mixture gets too hot, the proteins in the eggs solidify into clumps and separate from the milk. This is called curdling or breaking, and it's the greatest flaw in a custard. Fortunately, it's easily avoided.
Keep Your Temper
More often than not, novice custard-makers run into trouble at the very beginning. Combining your hot milk or cream with the beaten eggs -- called "tempering" -- is the most delicate part of the process, and it has to be done carefully. If you dump boiling milk willy-nilly into your mixing bowl, it stays hot enough to cook the eggs on contact. Instead, pour the hot milk into your bowl in the thinnest possible stream, and stir or whisk as you go. If you do it right the eggs cool the milk on impact and then, as you stir, the milk disperses throughout the eggs. Eventually they incorporate completely without making the eggs hot enough to coagulate and curdle your custard.
Please Be Gentle
Unfortunately, mixing the custard correctly isn't the end of the story. You still need to bring it to a high enough temperature that the proteins in the eggs can thicken and set the custard. If you're making a baked custard, such as a creme brulee or creme caramel, it should be baked in a shallow pan of water so the custard doesn't overheat and curdle. If you're making a custard sauce on the stovetop, place the pot that holds the custard over a pot of simmering -- not boiling -- water and stir it continuously. The eggs set slowly in the gentle, indirect heat, minimizing the risk of curdling.
Hold Me, Hold Me
Hovering breathlessly over a double boiler isn't the most enjoyable way to spend your evening, and it can mean a substantial delay between dinner and dessert. Making your custard ahead and keeping it warm is a more practical option, but you have to be very careful about temperature. Custard is an ideal incubator for bacteria, so it must be held at a food safe temperature of 140 degrees Fahrenheit or greater. Unfortunately your custard will curdle at 175 to 180 F, so you need to manage the temperature carefully. Pouring the hot custard into a preheated vacuum container is the simplest answer; the container can hold it at a safe temperature for hours.
Your Cheatin' Heart
When all else fails, do what the professionals do: cheat. Holding custard sauces or warm custard desserts is just as problematic for chefs as it is for home cooks, so restaurants often stabilize their custards with a small amount of starch. Whisk a small amount of instant-mixing "gravy" flour or cornstarch into your custard recipe's sugar, then go on and make the recipe as you normally would. As the custard comes up to temperature, the starch thickener begins to thicken the liquids, as well. The mesh of starch molecules helps keep the egg proteins from bonding, reducing the risk of curdling and providing a more heat-stable custard.
Getting Back Together
If your custard starts to break at any point, you can usually salvage it if you act quickly. Set your mixing bowl in a sink or pan of cold water to quell the heat, then pour your custard through a fine mesh strainer to remove any fine grains of coagulated egg. Separate an egg yolk into a new mixing bowl and whisk it vigorously. Pour your custard into the bowl in a thin stream, just as you did originally with the hot milk. When it's all incorporated, return your custard to the double boiler and finish cooking it at a lower heat.