Rick Beato made a video or two about that. His son Dylan has perfect pitch. What he did when the boy was very little was to let him listen to various types of jazz music - he can't be certain, but his theory is that if the music is "interesting" in the sense that it's not always predictable then the brain automatically zooms in on that and gets interested - and that's what gave the boy perfect pitch (I believe this theory relies on an underlying theory - a quite common one - which is that babies are actually born with perfect pitch but lose it relatively early, just as all babies are born with the ability to hear every sound in every language, and that also gets filtered off as they get older. This last one is pretty certain, the other one is still debated).