A gratin is made out of thin slices of potatoes with layers of ingredients. Medium starch potatoes like Yukon gold are best because they bind together without consistency loss. Dairy also helps to bind it together. Squeezing the dish before cooking helps as well. When cooking, aluminum foil on top helps prevent burning. It should set for some time after it's cooked. If a fork goes in easily and you can see layers, it's done.