Ananas comosus is a plant that requires soil that is rich and well-drained to grow well. Special Bromeliaceae soil mix seems to be the best solution for your ananas comosus.
Ananas comosus never grows far-reaching roots, which is why a small pot, about 6 inches (15 cm), is more than enough.
You will only need to repot when you want to split new shoots from the main plant.
Ananas comosus requires a well-drained substrate, which is why adding sand is relevant.
Ananas comosus roots hate having too much water.
Double-check that the pot has a hole drilled in the bottom.