I'm a beginner in Blender. I'm currently following a tutorial for a character mesh, and I'm following it very closely. I ran into an issue with the foot. To close the sides of it with a face, I was trying to use Grid Fill, but it wouldn't let me (I can't remember the error message). I had to fill it with triangles, and then have them changed to squares so that geometry was even with the rest of the mesh.
Everything looked fine, but then I applied Shade Smooth on the mesh and added a Subdivision Surface modifier, and this happened to the ankle (what's below the red line in the image):