If your pudding is grainy then the egg yolks curdled when you added them to the hot milk. To fix a grainy pudding, strain the mixture before refrigerating.