Implementing collision and key pressing at once

I am trying to get my game so if you walk up to a sprite and stand next to it then press space you can talk to it. My code doesnt continuously check after a collision how would i get it to do so.

void OnTriggerEnter2D(Collider2D Talk)
{
    if (Talk.gameObject.CompareTag("Player") && Input.GetKeyDown("space"))
    {
        Debug.Log("HI");
    }
}

try changing your OnTriggerEnter2D to OnTriggerStay2D. This will continually fire when your player is within the trigger zone.