Caught my 4 year old trying to stand on my 2 year old

I was about to walk out of the room for and I caught my four year old getting ready to stand on my 2 year olds chest. I right away grabbed her and explained very sternly that this is not allowed and she could hurt him. I am so concerned about this. What would you do in this situation?