Error: CS8803 New to game development and was following tutorial on endless runner game need help!

I was following a tutorial when I this error popped up and I don’t know how to fix it. Does anybody here know what the problem is and how to fix it?

Here is the link to the video, the code and the error message:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
   public float playerSpeed;
   private Rigidbody2D rb;
   private Vector2 playerDirection;

    // Start is called before the first frame update
    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }

    // Update is called once per frame
    void Update()
    {
        float directionY = Input.GetAxisRaw("Vertical");
        playerDirection = new Vector2(0, directionY).normalized;
    }
}
    void FixedUpdate() 
    {
       rb.velocity = new Vector2(0, playerDirection.y * playerSpeed);

    }

https://www.bing.com/videos/search?q=endless+runner&&view=detail&mid=516906BFA23C410ABCB1516906BFA23C410ABCB1&&FORM=VRDGAR

Assets\Scripts\Scripts\Player.cs(24,5): error CS8803: Top-level statements must precede namespace and type declarations.

As the error states, you have closed NewBehaviourScript and are on the top level when you declare void FixedUpdate(). You should remove the } on line 23…

This is easy to see as you have done indentation correctly…