In Japanese number culture the lucky numbers are 3, 7 and 8, and the two people avoid are 4 and 9. Four is awkward because one of its readings, shi, is the same syllable as 死, death. Nine is awkward because one of its readings, ku, is the same syllable as 苦, suffering. Seven is lucky through Buddhism and through the Seven Lucky Gods. Eight is lucky for a reason that has nothing to do with sound at all: the character 八 opens outward as it descends.
Japanese kept two counting systems, the native one and the one borrowed from Chinese, and the collision between them is what created the taboo and then supplied the way out of it. Four is either yon or shi; nine is either kyū or ku. The Sino-Japanese readings are the dangerous ones, and ordinary speech has settled firmly on the native alternatives. A shop assistant counting stock says yon. Phone numbers are read with kyū. The escape hatch is built into the grammar, which is unusual.
How much of it anyone believes is a separate question. The avoidance is institutional before it is personal, so you meet it in hospital corridors and vehicle registration rules long before you meet it in conversation. Younger speakers will tell you the whole thing is nonsense and then still hand over three notes at a wedding rather than four.