You might want to try watching some basic C# tutorials if the above is what you’re using, it’s not even valid. You’ve got one method defined inside another, not on the MonoBehaviour parent class.
Please use code-tags for any code posts, including snippets.