How do I test for the Y Coordinate?

So I am trying to test if my player is at a certain y coordinate (2 in my case), and I don’t know how to do it. Oh and I’m doing it in C#

Mathf.Approximately(transform.position.y, 2)

Mathf.Approximately is nice to use because sometimes, float values are almost alike, but not exactly.