I got this this error: Assets\player_good.cs(56,52): error CS1002: ; expected, Here's my code:

  1. using System.Collections; using
  2. System.Collections.Generic; using
  3. UnityEngine; using
  4. UnityEngine.SceneManagement;

public class player_good :

MonoBehaviour {
    public float speed ;
    public float JumpForce;
    Rigidbody2D rb;
    bool OnGround;
    private Animator anim;
    SpriteRenderer sprite;
    // Start is called before the first frame update
    void Start()
    {
        rb=GetComponent<Rigidbody2D>();
        OnGround=true;
        sprite = GetComponent<SpriteRenderer>();
        anim=GetComponent<Animator>();
    }
    // Update is called once per frame
    void Update()
    {
        float player =Input.GetAxis("Horizontal");
        transform.position += new Vector3(player*speed,0,0);
        if (Input.GetKeyDown(KeyCode.Space)&&OnGround)
        {
             rb.AddForce(new Vector2(0,JumpForce));
             anim.SetTrigger("jump");
        }
        //flipping
        if (player>0)
        {
            sprite.flipX=false;
        }
        else if (player<0)
        {
            sprite.flipX=true;
        }
        if(player!=0)
        {
           anim.SetBool("is wolking",true);
        }
        else
        {
           anim.SetBool("is wolking",false);
        }
    }
    private void OnCollisionEnter2D(Collision2D
collision)
    {
       if (collision.gameObject.tag=="Ground")
       {
         OnGround=true;
       }
      else(collision.gameObject.Comparetag=="end")
       {
         SceneManagement.loadScene("Sample
Scene");
       }
    }
    private void OnCollisionExit2D(Collision2D
collision)
    {
       if (collision.gameObject.tag=="Ground")
       {
          OnGround=false;
       }
    } }

In general @MUG806 is right. Please follow the suggestions in their post.

The issue that you have in your code is in this line where you use compareTag incorrectly:

else(collision.gameObject.Comparetag=="end")

instead it must be:

 else(collision.gameObject.Comparetag("end"))

as CompareTag is a function, not a variable.

I’d further suggest to also change this line:

  if (collision.gameObject.tag=="Ground")

to use CompareTag as it is way more performant.

As the error message says. You are missing a semicolon at the end of a line of code. The error tells you around where the issue is. Please in future do some basic Google searches on error messages before coming here, as this is a very basic C# error that has nothing to do with unity specifically, and the error message itself even tells you how to resolve it.
Also when posting code please use the code formatting button as it’s very hard to read your code without it.