Yes, you need to try an assortment of pellets to see what your gun likes and then stock up on those that perform the best for your purposes. Often, for popular guns, there's lots of good info here on the forum of which pellets/tunes people are having success with and that's usually a good starting point. But your own experimentation with other pellets can often reveal some sleepers.
But don't be quick to sell any pellets that happen to not shoot well in that particular gun, because they may shoot great in a different gun if you try more guns down the road. It's nice to already have an assortment of pellets on the shelf to experiment with. I always shake my head when I see people selling a tin or two of pellets simply because they didn't perform well in a specific gun. Let that pellet inventory build up over the years as you purchase them, at least by keeping a tin or two of each brand/model/weight. Saves a lot of time and money in the long run.