It is always a good idea to take profits when you have a successful investment. If you have a well-balanced, diversified portfolio, then this means re-balancing. If bonds make up 30% of your portfolio and they perform strongly in a short time and now make up 40% of your portfolio, then you should sell off that gain and re-balance. You can take the profits and buy the portion(s) of your portfolio that has sunk in its percentage. In other words, if stocks were previously 30% of your portfolio and have now gone down to 20%, you can take the profits from the bonds and buy more stocks to re-balance back to 30% stocks and 30% bonds.
If you are speculating in a particular stock or investment, then taking profits is even harder. If a stock doubles, why not sell half and protect your initial investment? It is hard to sell after an investment has done well because it seems like the sky is the limit. But remember that it can go down just as fast as it went up. Don't get too greedy. When you have a good investment, take some profits. If you have an online brokerage account, it is even better to set a price target when you buy a stock, fund, or ETF. If you buy 100 shares of a stock at $20, you can put in a limit order to sell 50 shares at $30 and make it "good until cancelled". Then you don't have to think and you won't let your emotions get the best of you. It is always good to be taking profits from successful investments.