The key is to remove as much moisture as possible from the grated potatoes. Soak them in cold water, then drain and squeeze out the water with a clean kitchen towel or absorbent paper towel before cooking.