Help player can move vertically

this is the code, i dont know why its

public class PlayerController : MonoBehaviour
{
    public float speed = 5;
    public float horizontalInput;
    public float verticalInput;
    public Rigidbody2D rb2D;
  


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

    // Update is called once per frame
    void Update()
    {
        verticalInput = Input.GetAxis("Vertical");
        horizontalInput = Input.GetAxis("Horizontal");
     
        rb2D.MovePosition(rb2D.position + Vector2.down * speed * verticalInput * Time.deltaTime);
        rb2D.MovePosition(rb2D.position + Vector2.right * speed * horizontalInput * Time.deltaTime);
    }
}

you are overwriting the line 23 with line 24.

public class PlayerController : MonoBehaviour
{
    public float speed = 5;
    public float horizontalInput;
    public float verticalInput;
    public Rigidbody2D rb2D;



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

    }

    // Update is called once per frame
    void Update()
    {
        verticalInput = Input.GetAxis("Vertical");
        horizontalInput = Input.GetAxis("Horizontal");
    }

    private void FixedUpdate()
    {  
        float x = rb2D.position.x + horizontalInput * Time.fixedDeltaTime * speed;
        float y = rb2D.position.y + verticalInput * Time.fixedDeltaTime * speed;
        rb2D.MovePosition(new Vector2 (x, y));
    }
}