Getting Scene index as int

Im trying to simply get the scene index as an int.
With the new Unity.SceneManagment it should be easy but Im still experiencing problems.

I tried using
Scene.BuildIndex but couldn’t figure out how to get the index from the scene the script was in.
And then I moved on to using SceneManagment.GetActiveScene and that has led to where I have the script attempt now which is

SceneManagment.GetActiveScene = new int (y);
int y = SceneManager.GetActiveScene();

although neither attempts are proving successful.

Is there any way to get the build index, as an int, from the current scene the.

Any help would be appreciated thanks

int y = SceneManager.GetActiveScene().buildIndex;

SceneManager.GetActiveScene() returns a scene and bulidIndex returns that scene’s build index.