Can't store value in the variable

In my game I use code player.GetComponent(); a lot of times, so i want to store it in the variable to make code easier. But I have error:

    public GameObject player;
    
    // A field initializer cannot reference the non-static field, method, or property
    Rigidbody obj = player.GetComponent<Rigidbody>();

Edit1:

public GameObject player;

    Rigidbody obj = player.GetComponent<Rigidbody>();
    
    void Update () {
    // Move Up
    	if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
    	player.GetComponent<Rigidbody>().MovePosition(
        player.GetComponent<Rigidbody>().position + speedUp * Time.deltaTime * playerSpeed);
        //...
    }

You should try it in Start function

I’ve tested it and this seems to work:

public GameObject player;
 
     Rigidbody obj;

     void Awake () {
        obj = player.GetComponent<Rigidbody>();
     }
     
     void Update () {
         // Move Up
         if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
         obj.MovePosition(
         obj.position + speedUp * Time.deltaTime * playerSpeed);
         //...
     }

As I mentioned it’s because you cannot use an instance variable to initialize another instance variable.