During the 1973 oil embargo, the US relied more heavily on Venezuelan oil. The Venezuelan president (not a socialist) intended to nationalize oil to finance the diversification of Venezuela’s economy. So nationalization started in 1976.
But they never got around to diversifying their economy. Throughout the 1980s and 1990s, predatory foreign capitalists acted as loan sharks against Venezuela. Debt and turbulent oil prices led to rampant inflation.
For two decades, under US neoliberal guidance, the Venezuelan government tried the standard capitalist austerity measures, such as: privatization, deregulation, budget cuts, union-busting and submission to IMF coercion via more debt.
None of this improved their economy.
In fact, while education levels reached new heights in the ’80s and ’90s, employment and wages cratered. The country slid into further inequality, instability and a series of impeachment and coup attempts.
When people protested against capitalist austerity measures, the government responded with mass executions.
Working class people, unhappy with these conditions, voted for the left-wing Chavez in the 1998 election. His political program, dubbed “Chavismo,” is not really textbook socialism (because socialism is when workers own the means of production and exchange). However, Chavez tried to redistribute wealth away from international companies and towards the working class, so let’s go ahead and concede that this is sort of socialist.
In 2002, the right wing attempted a coup (with the CIA’s tacit approval or outright participation, depending on how much you believe the Bush administration’s version of the story). But the coup failed to remove Chavez from office.
When Chavez first came to power, his neoliberal opponents still controlled the state-run oil company. Concurrent with the failed coup in 2002, they cut oil production in order to de-fund Chavez’s promised social welfare programs. They hoped the ensuing economic recession would undermine working-class support for Chavez. It’s a strategy that successfully unseated leftist leaders in other Latin American countries.