That’s a very unrealistic goal unless you’re legit genius-tier IQ.
A better goal might be to retire at 40-45 with a million, or maybe to save up 300k or so by 30-35 and find a business you actually enjoy working in and invest the money you’ve saved to start it up.
If you’re actually genius-tier (don’t even bother trying if you’re <145 IQ, you will fail), the only path to achieving this without nepotism or a great deal of luck is to be a quant. You will need to double major in undergrad, one of your majors should be math or CS, you can mix the two or pick up a second major in physics, economics, chemistry or anything stem related.
From there, the long term profit maximizing route is to get a PhD then a quant job, however you won’t finish your PhD til you’re 26-27 most likely and even at 300k starting you won’t have a mil by 30. The short term results route is to get a masters in quantitative or computational finance from a top 10 program and go to Wall Street, live in a $2000/mo studio eat cheap groceries invest your entire bonus and half your paycheck and you can maybe stack a mil by 30, certainly by 35.
Be warned: earning extreme amounts of money is addictive and it’s likely you’ll want to keep selling your soul for ever increasing amounts of money and won’t retire until you’re old and your soul is shriveled and twisted beyond recognition.
If you’re not legit genius tier IQ, there are many ways to save a mil and retire in your 40s, study SE, EE, just math and be an actuary, get a PhD and get a job in industry, you’ll have to work hard but it’s very achievable. If you try and go the quant route as a midwit you’ll end up in some fucking hellish risk management office full of chinks making 70k a year.