Unity is not finding "Collider2D"

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

public class levelcontrol
{
void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag(“Player”))
{
SceneManager.LoadScene(2);
}
}
}

For this to work, you need your class to inherit from Monobehaviour, which also means you have to include the UnityEngine namespace.

using UnityEngine;
using UnityEngine.SceneManagement;

public class levelcontrol : MonoBehaviour
{
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            SceneManager.LoadScene(2);
        }
    }
}