It is generally recommended to withhold food and water from a dog for at least 12 hours before surgery to reduce the risk of vomiting and aspiration during the procedure. Your veterinarian will provide specific instructions on exactly when to stop giving food and water.