How do I check for tag of the last object I collided with while using ontriggerexit?

So I’m making a 2d platformer, and want to turn on a bool when an enemy stops touching the ground. I have the ground called ‘ground’, and want to make it so it goes something like this:

OnTriggerExit2D
{
if the tag of last touched object = ground
{
set bool to true
}
}

I’m just not sure how to do this… any ideas?

Did you look at the documentation?

The Collider2D is an object that you can check the tag on…