How can I collect collider2Ds(Trigger) the player is in into an array

I’m now trying to figure out how I can make a script that collects any game objects with triggers, with the tag ground that the player is currently in. So if the player is in one ground trigger it is collected and stored in the array and if the player is not in the trigger the trigger is removed from the array. Ultimately a variable will be collected from the objects in the array which will then be sorted in highest first. Can anyone come up with a script that can do this?

public class GroundBlock : MonoBehaviour {
public int height;
}

Private List<GroundBlock> grounds = new List<GroundBlock>();

OnTriggerEnter(Collider other) {
    if(other.tag == "ground") {
        groundComponent = other.GetComponent<GroundBlock>();
        if(groundComponent != null && !grounds.Contains(groundComponent)) {
            grounds.Add(groundComponent);
            grounds = grounds.OrderBy(g => g.height).ToList();
            // grounds = grounds.OrderByDescending(g => g.height).ToList();
        }
    }
}

OnTriggerExit(Collider other) {
    if(other.tag == "ground") {
        groundComponent = other.GetComponent<GroundBlock>();
        if(groundComponent != null && grounds.Contains(groundComponent )) {
            grounds.Remove(groundComponent);
        }
    }
}