It is usual to place a stop loss order when you make a trade of any type, as this will prevent your losses mounting up should the trade go against you. If your trade goes in a profitable direction, then you can manually keep moving a stop loss order just under the price to lock in your profit in case it reverses; but a much better solution is to use a trailing stop loss order.
The trailing stop loss order is similar to a stop loss in that it becomes a market order to sell when the price drops down to the level of the order. The difference is that a trailing stop loss order constantly and automatically has its level changed by the price movement, and you don't have to update the level manually.
When you set up a trailing stop loss order, you specify how far below the price you want it to trail. Usually this is entered as an absolute amount, although the idea still works if it is a percentage. The price level of the order will never be more than that distance away from the actual price, as it will be updated whenever the price moves.
The 'magic' of the trailing stop is that it will only alter if the price of the asset moves in a favorable direction i.e. should the price move against the trader the price of the trailing stop-loss order won't vary. If the price stops moving in the right direction, and starts to fall, the distance between the stop loss level and the price will reduce; the level will not change. You can think of this as a ratchet, allowing the trailing stop loss level to increase freely, but not drop.
If the price continues to fall it will hit the trailing stop level, the order will be activated and the position liquidated, locking in most of your profit. You will only be down from the peak about as much as the trailing distance you set. Note that it doesn't have to be exactly the amount you set, as the trailing stop loss order becomes a market order to sell when triggered, so the price can vary slightly.
Trailing stop-loss orders are similar in workings to stop-loss orders with the difference that the price of the order moves in accordance with a pre-determined distance from the present trading price, this distance is set by the trader at the time of placing the order.
When you set a trailing stop, you need to consider how large a gap you want from the price. If you set the distance too small, then you may find that regular price fluctuations trigger the sell order, even though the financial security has not finished its upward run. The disadvantage to setting the distance larger is obviously that it has further to drop from the peak before the position is liquidated. You have to study the normal movement of the price so you can pick a level.
The description above is for a long trade, where the price increases for a profit; you can of course also trail in the opposite way on a short position.
Finally, although most brokers include the trailing stop loss order in the range of orders you can place, there are some that do not; you should check carefully before setting up your account with a broker to make sure that they are available, if you consider that you might want to use them.