As Tom points out, we can’t really see what course you are asking about, but one possible cause here is how the notebooks work: if you restart the notebook, you need to rerun all the previous cells. So where is find_closest_centroids defined? It must be in an earlier code cell. Did you run that cell? Just having the code sitting there does nothing until you actually run the cell in order to get it loaded into the runtime image. Try this:
Cell -> Run All Above
Then try running your failing test cell again.
If that doesn’t work, then you need to go back and look at the cell that defines find_closest_centroids. Maybe it has a syntax error, so running it just threw an error.
Here’s a topic on the DLS FAQ Thread which discusses the “function not defined” issue in a bit more detail.