It is natural for career goals to change and get narrower/focussed as one gets older. A high schooler’s career goals are obviously broader, like scientist, doctor, engineer, singer, etc., and as they progress through their lives, their career goals get narrower and narrower.
In my case, all that I knew in high school was that I broadly wanted to be a scientist or a research engineer. Then in my final year of high school, I realized that I was most interested in electronics and circuits, so I decided to pick electrical engineering for college.
Then, in my final year of undergrad, I understood that the part of EE that most interested me was semiconductor chip design and semiconductor device physics. Based on that, I applied to graduate school in EE and mentioned those areas in my Statement of Purpose.
Once I got into graduate school, I took a professor’s class on semiconductor physics and subsequently joined his research group. He had funding for a project on laser design, so over the course of 4 years, I became an expert in semiconductor laser design.
This led to me getting employed in corporate R&D as a laser research engineer.
I achieved my childhood career goal, and that goal kept getting better defined with time and with relevant educational and work experience.