Hello.
"you can still castle on a subsequent move, but only after you get out of check."
Does it mean prevent check from happening or escaping it or something else?
To get out of check indicates that you are in check. It's the same as getting out of a swimming pool. You can't get out of the pool unless you are in the pool.
What the sentence says is that you can perform the move in chess called castle, but not while you are in the position called check (your king is subject to being taken if you do not move the king or move a piece in front of the king). When you move the king or put a piece in front of your king, you may castle.