There are quite a few issues I see with your setup.
You are setting up the ESC in your code to use pin 9, but your diagram shows that you've connected to pin 8. Pin 8 won't do anything because the code is writing to pin 9.
You are setting up the ESC in the code, but then you are never actually writing to it. You need to use ESC.write() and pass some value ...
This project does exactly that on an RC car. The author is a top competitor in the DIYRobocars community; it's the blue car in this video. He uses tachometry from the brushless motor, an IMU and visual odometry for localization. I don't know the code well enough to point you to any specific file.