Player won't jump in unity2d

here’s my jump code it updates in void Update

 void Jump()
{
 if(isgrounded == true)
 {
 amountofjumps = jumps;    
 }
 if(Input.GetKeyDown(KeyCode.UpArrow) && amountofjumps > 0)
 {
 rb2d.velocity = Vector2.up * jump * Time.deltaTime;
 amountofjumps--;
 }
 else if(Input.GetKeyDown(KeyCode.UpArrow) && amountofjumps == 0 && isgrounded == true)
 {
 rb2d.velocity = Vector2.up * jump * Time.deltaTime;    
 }
 
}

here are the variables I use for my jump code

bool isgrounded;
public float groundcheckradius;
public LayerMask whatisground;
public float jump;
private int amountofjumps;
public int jumps;

here’s how I detect the ground

 void checkforground()
{ 
isgrounded = Physics2D.Raycast(transform.position,Vector2.down, groundcheckradius,whatisground);
   
}
void OnDrawGizmos()
{
Gizmos.color = Color.red;
Gizmos.DrawLine(transform.position, transform.position + Vector3.down * groundcheckradius);

thanks in advance

You should put your jump code in

Fixedupdate()
{
     //your code here
}

And replace line 9 and 14 with

rb2d.addforce(transform.up * jumpstrength, rb2d.impulse);

//or

rb2d.addforce(transform.up * jumpstrength, rb2d.force);

And dont forget to add

Public int jumpstrength = 5

//or put the variable on private