Is it OK to buy clothing for a baby before it’s born?
Although some have the custom to refrain from buying clothing and other items for a baby until it’s born, there is no explicit Torah source supporting this tradition.
Some suggest that it’s psychologically motivated—if Hashem has other plans and the pregnancy has a different outcome, chas v’shalom, having these items would be painful for the mother. Others suggest that the reason may be a practical one: it’s difficult to shop when one doesn’t know whether the baby will be a boy or a girl.
There are those who maintain that this custom does have a source in Torah, and say that shopping for a baby before it’s born could arouse an ayin hara (evil eye).
In practice, based on the principle attributed to the Rashba—that issues that nashim zekeinos (elderly Jewish women) are concerned about should be taken seriously—one should refrain from buying baby items in advance. However, if there’s an amazing deal, or it won’t be possible to buy the item later, or the fact that it was bought beforehand is not known to others, or the item is left in the store until after the baby’s birth—then there’s absolutely no problem with buying it ahead of time.
https://asktherav.com/what-is-the-chabad-minhag-in-regarding-purchasing-new-items-for-a-baby-before-he-she-were-born-and-does-it-also-apply-to-things-that-are-necessary-immediately-after-leaving-the-hospital