A stop-loss is a way of closing an existing open position at a set level, when the market goes against you. It prevents from taking further losses, hence protecting your capital. If you are taking a long position, it is a good idea to place your stop-loss below the support level. When you trade a head and shoulders pattern and take a short position, you can set your stop above the right shoulder of the pattern.
A stop-loss is a psychological tool in the hands of an advanced trader to analzye the market, besides relying on a support or resistance level. It prevents from taking too many losses and accept just one single loss. It is important for a trader to accept losses as they are part of trading. It is important that you don't let your losses grow or it could result in a margin call.
For example, look at the GBP/USD pair. The pound fell steeply after the Brexit referendum came out with a yes vote, to leave the EU. Those who had traded this pair on that night, without a stop-loss, would have only wiped out their accounts. Hence, you must use a stop-loss for all of your trades, to protect your capital.