How did Josef Stalin gain power?

Firstly he was elected as General Secretary of the Communist Party to aid Lenin, however when Lenin became incapacitated, Stalin employed ruthless political tactics and used his power as General Secretary to dismiss supporters of Trotsky and other leaders. He then replaced the vacant positions with his own supporters. Another of his ruthless tactics was when he told Trotsky the wrong date of Lenin's funeral making him hated. He also began to play the two halves of the politburo against each other first he allied with the leftist part Zinoviev and Kamenev whom wanted world revolution to force Trotsky into exile and then joined the rightists Bukharin, Rykov, and Tomsky and advocated Socialism in One Country which stated that Russia should first become strong in order to dismiss the leftists Zinoviev and Kamenev. After this he argued that the NEP ( New Ecomomic Policy ) was anti-communism and had Bukharin, Rykov, and Tomsky dismissed. Stalin schemed his way to power using ruthless tactics: 1. Firstly he dismissed all his political foes supporter's and replaced them with his own 2. Then he sided with the Leftists to have Trotsky exiled 3. Then he sided with the Rightists to have the Leftists dismissed 4. and finally he argued that the NEP was anti-communism nd had the leftists dismissed Stalin merely eradicated his enemies and culminated his own supporters in order to become supreme ruler of Communist Russia.
As Communist Party general secretary from 1922 he concentrated control of the party apparatus in his own hands during and after Lenin's final illness, favouring his sympathisers. After Lenin's death he successfully urged a policy of early industrialisation and collectivisation of agriculture in opposition to his rival Trotsky, who sought to expand the revolution abroad before concentrating on socialisation of the Soviet economy (though much of Stalin's programme ironically echoed that of Trotsky's 1920s ally Preobrazhensky). With Trotsky defeated within the party, Stalin turned to repression to crush his opponents, first exiling Trotsky and then launching a series of party and government purges culminating in the execution on trumped-up charges of key leaders and thousands more party members as well as hundreds of thousands of officials, specialists and other citizens.
Stalin tried to live up to the ideal of a man who united political power and intellectual acumen. Between the end of the Second World War and his death in 1953 he intervened in scientific debates in fields ranging from philosophy to physics.2 In late 1946, when Stalin was sixty-seven years old and exhausted from the war, he schooled the USSR's most prominent philosopher on Hegel's role in the history of Marxism. In 1948, while the Berlin crisis threatened an irreparable rift between the United States and the USSR, Stalin wrote memos, held meetings, and offered editorial comments in order to support attacks against Mendelian genetics. In 1949, with the first Soviet atomic bomb test only months away, Stalin called off an effort to purge Soviet physics of "bourgeois" quantum mechanics and relativity. In the first half of 1950 he negotiated a pact with the People's Republic of China and discussed plans with Kim Il Sung about invading South Korea, while also writing a combative article on linguistics, carefully orchestrating a coup in Soviet physiology, and meeting with economists three times to discuss a textbook on political economy. In some cases he denounced whole fields of scholarship, leading to the firing and occasional arrest of their proponents. His efforts to unmask errors in science were paralleled by an equally intense drive to show how each discipline could contribute to building communism and serve as a symbolic weapon of Soviet superiority in the battle with the West along an "ideological front."