Want to get paid, by the US Federal Government, for pursuing science or technology?
From experience, in simple terms, a word: Have the work for and the funding from the US DOD, department of defense, military, for some work they really care about.
This sounds like a joke, but it's 90+% real.
For years early in my career in applied math and computing, far and away the best parts, funding, technically advanced work, growth in expertise, and working conditions were on US military work, e.g.:
(1) The FFT (fast Fourier transform) and power spectral estimation (as in the book by Blackman and Tukey) for analyzing ocean audio, close to parts of the movie The Hunt for Red October. Also, the movie uses magneto hydrodynamics (MHD), and the specialty of the guy I was working for was MHD.
(2) Some optimization using Lagrangian relaxation for nuclear war.
(3) Given many ships at sea, some Red, some Blue, and some Blue submarines, war breaks out, and how long will the ships last, in particular, the Blue submarines? Sounds impossible or nearly so, but in WWII there were some cute derivations on search at sea and some Poisson process math by a guy Koopmans, and I did a little more on the math, in assembler wrote a random number generator starting with an Oak Ridge formula, and wrote some Monte Carlo code for the whole thing -- yes, used the speeds of the ships, their detection radii, and for each Red-Blue pair the probabilities of none die, one dies, the other dies, both die.
Surprisingly, a famous probability prof was flown in for a fast review. His remark was: "No way can your Monte Carlo fathom the huge sample space tree." Well, maybe, but so what?
"After some days, say 5, let X be the number of Blue submarines still alive. Then X is a random variable and is bounded, that is, is >= 0 and <= the finite number at the start. Then the law of large numbers applies, and can do 500 independent and identically distributed sample paths, add, divide by 500, and get the expected value for the 5 days, and each of the (times) days, within a gnats ass nearly all the time." The prof agreed but was offended by the gnats remark!
Sure, it was simple, but maybe not fully too simple -- was liked, passed the review, and helped my wife and I get our Ph.D degrees.
Also the military funding let me sit alone for some days learning PL/I that later, with a tricky feature of PL/I calling back into the stack of routines called but not yet returned, used to save IBM's AI product YES/L1! Ah, military worked again!
Ah, the military may (still) be interested in computer and communications security and reliability, system design and development methodology, system monitoring, and management, and now in AI, drones, etc. A commercial server farm or network doesn't expect to be attacked by long range missiles, but DOD systems have to be robust in a war!
Once I was at the David Taylor Model Basin (big tank of water to tow candidate ship hull designs), and they were seriously interested in the Navier-Stokes equations -- maybe they still are! Uh, do they have good solutions yet?