Why wont this script work?

I was watching a tutorial and it told me to write this and it wont put Ouch in the debug log

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Collision : MonoBehaviour
{
    void OnCollisionEnter2D(Collision2D other)
    {
        Debug.Log("Ouch");
    }
}

Hello.

This is because OnCollisionEnter2D() is not beeing called, because you do not meet the condition to it. (normally because components in the objects are not correct, or you miss a rigidbody).

Bye.