Steal/adopt the technology from someone else
We have lots of experience with countries growing rapidly more technological advanced very quickly by adopting technologies already invented elsewhere. Japan, Korea, and the United Arab Emirates are all examples of countries that have experienced this kind of dramatic modernization.
There are other less well known examples.
The Comanche Indians in the U.S. adopted first horseback riding, and then the use of firearms, from Europeans they encountered in first contact situations. Several U.S. Indian tribes developed written languages for their previously unwritten languages after European contract with huge implications for their societies.
The Etruscans in Northern Italy were one of the last few surviving non-Indo-European societies in Europe that outlived their peers because they rapidly adopted the technologies of the invading Indo-European Italic peoples.
The indigenous Maori people of New Zealand basically invented trench warfare in their wars with English colonizers (historically called the "Maori Wars" and now often called the "New Zealand Wars"), rapidly advancing to the state of military technology used by their opponents.
Another historical example is in the transition from the Bronze Age to the Iron Age. During the Bronze Age, the Hittites developed advanced metal working technology that was a closely guarded state secret for about 700 years, and gave their empire a decisive military advantage. During Bronze Age collapse ca. 1200 BCE, this empire fell and its metal working technologies were leaked, giving rise to the Iron Age almost everywhere.
One of the standard tropes in speculative fiction is for people on Earth to gain the knowledge from aliens, either invaders whose technology is stolen, or friendly aliens (a la Men in Black). The Foreigner series of C. J. Cherryh, and the Jaran series of Kate Elliot are other examples of this trope.
Closely related is the trope of technology transfer from one dimension to another seen, for example, in The Merchant Prince Series by Charles Stross.
This is also the trope utilized in the anime series How a Realist Hero Rebuilt the Kingdom, in which a civil servant from another dimension utilizes his educated layman knowledge of 20th century history and technology and science, along with his natural acumen and training as a junior Japanese civil servant, to use his power as king of the country that summoned him from his own dimension to not just insightfully identify potential key technologies for the kingdom, but also to come up with ways to maximize the dissemination of expertise that the kingdom already has but hasn't utilized to its fullest.
This is to some extent an allegory for the historical efforts of the Meiji Restoration in Japan to combine "modern advances", mostly but not exclusively from abroad, with traditional "eastern" values, after the stagnation that came from a couple of centuries of self-imposed isolation from the rest of the world left Japan seemingly powerless in the face of contact with United States Commodore Matthew C. Perry who came to Japan in 1853 in large warships with armaments and technology that far outclassed those of Japan.
Albania is another place where technology has stagnated and lapsed after a long period of isolation that developed technologically very rapidly when it was reopened to the outside world at the end of the Cold War, as it borrowed technology from its neighbors.
Another standard trope in speculative fiction is for ancient aliens to have left traces of advanced technologies that are rediscovered, a la Stargate and the anime series Spriggan.
An older trope from mythology, associated with the Prometheus myth, for example, is for the gods to provide technology that make a society more advanced. The mythological notion that the Japanese imperial dynasty descends from Amaterasu Omikami, the sun goddess, is likewise kindred to this idea.
Have a genius or three in a community that shares knowledge
Lots of revolutionary periods of scientific invention and technological advancement are attributable to a small number of geniuses.
Archimedes fit the bill in ancient Greece.
Einstein and a few of his peers discovered quantum mechanics and general relativity in the early 1900s over the course of about a decade.
A small core of innovators who have the ears of people capable of funding their research and disseminating it widely can have a massive impact on the rate at which newly discovered technologies advance.
Often having multiple geniuses who can interact with each other, either in the same city or region, or at scientific conferences, can lead to the rapid exchange of ideas that allows all of the advances to cross-pollenate and increase the rate of innovation.
We don't necessarily think of Napoleon as a technological innovator, but in terms of law, government, and military organization he was a genius who rapidly and profoundly changed how society and governments and armies worked all over Western Europe.
Rediscover the work of past geniuses who were ahead of their time
There is also a rare but real scenario not entirely unlike the ancient aliens concept where a brilliant scientists works away for decades in obscurity, without being identified by someone who understands their work or builds upon and utilizes it.
One example of this is the intellectual history of fractals, whose work languished in obscure journals for several decades before it was rediscovered in the 1960s by Benoit Mandelbrot who was able to utilize emerging computer technologies to show the power of the concept.
Another example of this is chromium steel, which was perfected by a small community of metalworkers in Iran hundreds of years before the idea was independently reinvented and widely dispersed. But, this idea could have been adopted and spread widely at any time in between if someone had just rediscovered this pre-existing technology. See Rahil Alipour, Thilo Rehren, Marcos Martinón-Torres, "Chromium crucible steel was first made in Persia." Journal of Archaeological Science (2020); 105224 DOI: 10.1016/j.jas.2020.105224 (recounting their discovery that there was widespread manufacturing of chromium steel in Southern Persia around 1000 CE, a metallurgy technique that was subsequently lost and then only rediscovered about nine centuries later).
There was a similar case involving a sword maker by the name of Ulfberht in Northwest Europe somewhere who learned how to make steel swords profoundly better than anyone else of his era in the 800s or 900s CE or so, only for his art to be lost and reinvented many centuries later. But at any time in between, if someone had adopted this sword maker's methods (e.g. if an apprentice had survived and taught others) this technology would have advanced much faster.
The Italian Renaissance involved rapid innovation spurred and accelerated by a mix of rediscovering technologies from the Greco-Roman classical period and adopting technologies that had been developed in the Islamic empire, in a geographically small area with multiple geniuses who interacted with each other exchanging knowledge and who also served as rivals to each other.
The anime series Frieren: Beyond Journey's End, likewise involves a world where past magical knowledge was much greater but only person who knew her, her long lived elven apprentice, has access to her authentic grimoires and the understanding of them that came from working as her apprentice. Magic still exists, but its high points have been lost after centuries and Frieren's apprentice, in turn, gains advanced magical skill that no one else has. If that kind of rediscovered knowledge of a past genius were widely spread, the state of magical technology could have advanced rapidly.