Before.
Before you place a trade, you should plan for all possible outcomes. Have an exit strategy in mind whether the trade reaches your take profit price or your stop loss price. Then closing your trade either for profit or for loss is simply a matter of following your plan.
“It is said that if you know your enemies and know yourself, you will not be imperiled in a hundred battles; if you do not know your enemies but do know yourself, you will win one and lose one; if you do not know your enemies nor yourself, you will be imperiled in every single battle.” - Sun Tzu, The Art of War