Mainly by not being a modern, developed country in the first place.
You’re probably thinking this was Iran in 1960s.

Iran in 1960s and 70s
No. This was no more Iran in 1960s than Beverly Hills is USA in 2020s. A small slice of Iranian population lived a modern, developed life. The majority did not. An average Iranian in 1960s and 70s looked lived like this:

Also Iran in 1960s and 70s
Iran had a liberal elite centered in large cities who gave the country a modern, vibrant vibe. It also had a rural majority that was religious, conservative and outraged at the liberal elites.
Ayatolah Khomeini did not change Iran, he merely empowered the rural and religious folks to take up arms and explain to the liberals in cities their ways were mistaken and they would have to follow their rules from now on – at gunpoint, if needed be.
