What is StandardScaler in Machine Learning and how is it used for scaling features?

I’m working on a machine learning project, and I have a dataset with a lot of features. I’ve heard that I should scale my features before training a model, and I’m interested in using StandardScaler from Scikit-Learn to do this. Can someone explain what StandardScaler does and provide an example of how to use it in Python?

Here is my code: