When buying a pillow, you should consider your body type, preferred sleeping position, and the hardness of your mattress. Altogether those factors define how your spine is aligned during sleep. The most important factor is the sleeping position - it defines the right height of the pillow to support your spine and improve blood circulation. Side sleepers, on average, need taller pillows compared to back sleepers, while stomach sleepers require minimal neck support.
The second thing to consider is body shape because someone tall or with wide shoulders would need a higher pillow, while someone with a smaller frame would be better suited to a lower pillow.
The last point to consider is the mattress - if you have a soft and elastic mattress that you'd sink deeper into, we'd recommend a flatter pillow. However, if your mattress is a bit harder and you sink just a little, your pillow should be slightly higher.