What's wrong with this script

I am a beginner.
I was watching a tutorial on how to find the velocity of the player and I wrote This Script:

GameObject.GetComponent(Rigidbody2D).velocity = new Vector2(MoveX * PlayerSpeed, GameObject.GetComponent(Rigidbody2D).velocity.y);

and it shows this error twice on the same line:

How do I fix it?

You got the syntax wrong. This should be the correct syntax for it:

GameObject.GetComponent<Rigidbody2D>().velocity = new Vector2(MoveX * PlayerSpeed, GameObject.GetComponent<Rigidbody2D>().velocity.y);

This should work.