Detecting being crushed

My goal is to have my character die when something is colliding with them from both above and below. Currently, I can correctly have my character detect being on the ground, as well as being to the right and left of something while on the ground (code is not shown below). However, it seems like when a collider comes down from above, it pushes my character below the collider of whatever is below him, causing him to no longer be grounded. I was thinking a solution could be to use OnCollisionEnter2D to make the boolians true, then OnCollisionExit2D, return them as false. However, I’m not quite sure how to do that.

Anyone have any solutions for this bizarre issue? If this info is needed, the player rolls back and forth on the floor, and BoxCollider2Ds fall with a constant downward velocity with a kinematic Rigidbody2D.

{
var otherBounds = col.collider.bounds;
var yourBounds = col.otherCollider.bounds;

if (otherBounds.max.y <= yourBounds.min.y)
{
isGrounded = true;
}

if (yourBounds.max.y <= otherBounds.min.y)
{
isAbove = true;
}
if (isGrounded && isAbove)
{
Die();
}
}```

Thinking about it more, it would be better to use a list to store values. Using boolians could cause some bugs.

Is there a way to add a specific value to a list, then when exiting the collision remove the same object from the list? I.E, I’m touching three different BoxColliders, then I exit colliding one of the three, so now I’m colliding with only two, so I want the one I’m no longer colliding with removed from the collision list.