How to print a string after 2 seconds an object is destroyed?

I have made a pong game in which a ball collides with the right wall and then destroys, and then awards 1 point to the opponent. Then i need to make the game stop for some seconds and then restart the layout. My script is:

function OnCollisionEnter (col : Collision)
{
    if(col.gameObject.name == "rightWall")
    {
        Destroy(gameObject); //Destroys the object
        GameMaster.score_P2 +=1;  //Adds one to the score
        StartCoroutine(stop());    
        
    }
}

function stop(): IEnumerator {
	
	yield WaitForSeconds(2.0);
	Debug.Log('waited for 2 seconds');
}

The problem is that you’re destroying the object, so no function on that object can run after the current frame. You will need to run the function on an object that’s not destroyed. By the way, it’s easier to use Invoke for that sort of thing instead of coroutines.