Loadlevel is obsolete, but can't build if i use loadscene

Hello, I’m a beginner. I want to use a restart button. If I use the method Application.Loadlevel, the compiler would tell me it’s obsolete. But if I use EditorSceneManager.LoadScene, when I build, there will be errors like “Error building Player because scripts had compiler errors” and “error CS0246: The type or namespace name `UnityEditor’ could not be found. Are you missing an assembly reference?”. What should I do?
P.S. I use Mac, and I can build successfully in MonoDevelopment-Unity.

Well you shouldn’t use the EditorSceneManager, but the SceneManager. You shouldn’t import any namespace that starts with UnityEditor in a runtime script. The SceneManager is located in “UnityEngine.SceneManagement”