Foolishly held
In addition to all the excellent advice, you yourself know your answer.
From my pov, it depends on your trading instrument and trading timeframe. For me, when I couldn't pull the trigger and book the losing trade, setting a stoploss at the last bar's low helped.
Yes, sometimes this turns around just when you did it. If you had just held the position it would have turned around. Welcome to the hamster wheel monkey mind.
Stop the chain of pain, set a hard stop, protect your capital, build your buying power, learn your lesson (write it down & build) and move on.
Build = mocking up in your mind's eye being on the winning side, making the winning choices given a similar setup in the future.
. And maybe scale in next time, so it won't be so bone rattling to the account.