One common pitfall that trips up new programmers is file naming – more specifically, naming mismatches – which we can illustrate using line 5 from the previous screenshot of the C# file in Visual Studio:
public class LearningCurve : MonoBehaviour
The LearningCurve class name is the same as the LearningCurve.cs filename. This is an essential requirement. It's OK if you don't know what a class is quite yet. The important thing to remember is that, in Unity, the filename and the class name need to be the same. If you're using C# outside of Unity, the filename and class name don't have to match.
When you create a C# script file in Unity, the filename in the Project tab is already in Edit mode, ready to be renamed. It's a good habit to rename it then and there. If you rename the script later, the filename and the class name won't match. The filename would change...