You can say that someone "cut it close" when they wait too long to do something. It means that they are risking a problem or disaster.
For example, if your friend is supposed to take an exam tomorrow, but hasn't started studying for it yet, you can say:
You're cutting it kind of close, aren't you?
Or if a friend is driving and turns in front of an oncoming car, you can say:
Whoa! That was cutting it close!
The phrase "cut it close" is neutral, so you can use it in either formal or casual situations.