Change rotation of an object when it collides with a trigger?

I’m new to Unity in general. I’m trying to rotate a specific object (Box Collider) when it collides with a specific trigger on an object (Box Collider 2D component).

I’m not sure how to code this in C# though. What would I need to do to achieve this?

This is the most I’ve done really. Sorry if this doesn’t make sense, please ask me to explain things further if needed.

    public void OnCollisionEnter2d(Collider target)
    {
        //Check if the collider is a specific object?
        //Rotate the object in a specific direction
        
    }

public GameObject ObjectIWantToCollidedWith;
//Select this object in the hierarchy

    private void OnCollisionEnter2D(Collision2D collision)
    {
        
        if (collision.gameObject == ObjectIWantToCollidedWith)
        {
            //Rotates the object 10 units on the X axis when collided
            collision.transform.Rotate(10, 0, 0);
        }
    }