Please, be aware of the differences between long-term investment and swing trading (and day trading, for sure), as the advice for each one often goes against the others.
With long-term, from what I know, you’re looking 5-10+ years in your investment, so these ups and downs that you’re talking about (over a couple of months) are just fluctuations, when you look at the big picture, and shouldn’t affect your decision-making.
Instead, you need to think back at the reasons that made you buy the stock in the first place, something made you think that this stock is a good investment and will go up in the future. This would usually be good fundamentals (profitable, good vision, good CEO… etc). If that assessment still holds, then you simply stay in. If the assessment changes, then you look to move away.
Sometimes, if a stock has gone up by a lot in a short period of time, some investors suggest selling some of your shares. That way you bag the profits while also staying in. That way if it keep going up then great you’re still in, and if it goes down, then those profits are safe.
Things change years later when you get closer to retirement age where you want to start de-risking your portfolio and slow move to safer assets (bonds, I think… I’m not too familiar with this part, tbh). My guess from your post is that you’re not at that stage, yet.
Of course, please do your due diligence and do your own research. I would suggest finding 2-3 good investors on youtube and follow them, watch everything they post (be careful, there’s lots of rubbish on youtube). This can be a good place to start. ChatGPT is also often great at explaining concepts.
Look up DCA, and look up a guy on Youtube called Tom Nash (he often talks about long-term investments, DCA and trimming a position… etc… it might be helpful).
PS. Long-term investment isn’t exactly my thing, and I’m more into swing trades. The above is just some of the knowledge I picked up along the way.