Ukraine, as defined by a common language and cultural customs, first appeared about 1,500 years ago. This occurred at the same time Russia appeared. Russia managed to expand more rapidly than Ukraine and there are now six times more Russian speakers. Forcing others to adopt your language is a common tool for linguistic expansion. Ukrainians had much less ambition for imperial expansion. This means that the continued existence of the Ukrainian language and nationalism is something of an achievement, one that Russia is still seeking to suppress.
What is now known as Ukraine evolved from the unification of a number Slavic tribes speaking a common language (Ukrainian) and united around 900 AD when Swedish Vikings traded and raided into what is now Russia via major rivers like the Neva and Vistula, both of which allowed Viking longboats to travel deep into Russia. The earliest of these Nordic raiders were known back then as the Rus (old Norse for “rowers”), who eventually became Russia. This began in the 800s when the Rus captured Kiev and used it as the center of a Rus kingdom that came to include Kiev, portions of modern Belarus and Russia. This was the first Russian state and by the 1200s the Swedish influence had declined and been replaced by Ukrainian customs. The locals maintained some Nordic words and customs for centuries after that. The Kievan Rus empire was composed of many distinct Slavic tribes that all recognized the city of Kiev (to northern Slavs) or Kyiv (to the southeastern and southern Slavs) as the cultural and commercial capital of this empire that lasted about three centuries.
Russian and Ukrainians differ on the importance of the Kievan Rus empire with Russia seeing it as the cultural source of Russian/Ukrainian culture which Russia came to dominate. Ukrainian see the Kievan Rus empire as the origin of modern Ukraine while Russia evolved differently after the devastating Golden Horde (Mongol) invasion in the early 1200s shattered the unity provided by the Kievan Rus and was replaced by separate efforts to reunify as Russia and Ukraine. In the north a more successful effort was aided by the dominance of Eastern Orthodox Christianity while Ukraine always had a large number of Roman Catholics as well.
Russians concentrated on achieving access to the sea, in this case the Baltic Sea. The Ukrainians had to fight various groups of Mongols, Turks and even Italian colonies to gain access to the Black Sea. Mongol power was slowly diminished by local Russian, Lithuanian and Ukrainian princes, who ruled small principalities that sometimes fought as allies of the Mongols. By 1400 Mongol power was in decline and Ukraine and Belarus were a major component of the Polish-Lithuanian confederation, which defeated the Golden Horde as well as Germans advancing from the west. While powerful, the Polish-Lithuanian empire was surrounded by enemies and frequent internal conflicts.
Ukrainian history also honors the Ukrainian Cossacks, a frontier mounted militia that first appeared in the 1500s to protect southern borders from Turkic Kazaks and Tatars. The term Cossack came from an ancient Slavic work kozak, which meant a free man or adventurer. The need for kozaks arose when Ukraine established claims on lands in the south and southeast of what is now Ukraine but then was largely controlled by small numbers of mounted Tatars and Kazars. In return for official recognition and support (of individual land claims) bands of Cossacks emerged. Initially anyone could join, including Turks, as long as they swore allegiance to Ukraine and the elected leader (hetman) of each Cossack group (“host”). Sometimes the Polish nobles tried to renege on their promise of land title, and that led to the Cossack reputation for often being rebels, and effective ones on their own land. This led to a Ukrainian hetman Bohdan Khmelnytsky leading a rebellion against oppressive Polish nobles that led to brief (1649-1657) independence from Polish control.
Polish and Lithuanian power was reduced in the 1700s by wars with a unified Russian kingdom (tsardom), persistent German attacks from the west and growing Turkish power in the south. Emerging in the early 1300s, the Ottoman Turks conquered Constantinople (Istanbul) in 1452, ending the Byzantine (Eastern Roman) empire and giving the Ottomans control over access to the Black Sea from the Mediterranean. That control lasted until 1922, when an international treaty established limits on Turkish control over access to the Black Sea. In Russia, access to the sea (the Baltic Sea) was achieved in 1709,
The first (in 1547) tsar of Russia, Ivan Grozny, is known in the west as Ivan the Terrible. In Russian, "Grozny" means fearsome, menacing or, to many Russians, dreaded. Tsar Ivan spent most of his 37 years in power leading his armies against various enemies, as well as reforming the Russian government. He was largely successful against Turkic enemies that occupied what is now much of southern Russia and Ukraine. Ivan was ruthless and went full Grozny against his Turkic foes. Then he sought to take Livonia (Latvia and Estonia) to provide landlocked Russia with access to the Baltic Sea. At first Ivan was successful, but then Poland and Sweden intervened and turned Russia back into a landlocked empire until 1709 when tsar Peter the Great finally defeated the Swedes and made his new city on the Baltic, Saint Petersburg into the new Russian capital. Earlier (1686) Russia gained control of much of modern Ukraine, including Kyiv, via a treaty with Poland and Lithuania that was mainly about joint operations against the Turks. That campaign lasted until 1774 when Russia took over and the Ottomans renounced their claims to the Crimean Peninsula and a long-alliance with the Turkic Tatars. Earlier the Tatars had allied themselves with the Golden Horde and had long been a problem for Ukrainians. In some respects that is still true because the current Russian claim on Crimea traces back to their victory over he the Ottomans and Tatars in 1774.
The Cossacks largely disappeared during the two world wars because they were seen as fighting for Nazis (against Russians) or the for the Tsar (against rebels in general and communists in particular). Some fought for the Russians during World War II but after that they were outlawed everywhere. After the Soviet Union collapsed in 1991 some Cossack groups reformed, pledging to serve the new Russian government. Some of these fight against Ukrainians in the Donbas.
In the 1800s nationalism became a major movement in Europe, with ethnic components of empires and large countries demanding independence. Russia had more of these independence movements than anyone else and Ukrainians demanded autonomy within the Russian empire. During World War I (1914-18) the Russian empire began to fall apart and by the end of the World War a civil war was underway in Russia that enabled the Ukrainians to declare independence in 1917 as the UNR (Ukrainian National Republic). Ukraine was a major battlefield for the civil war which the communists (Bolsheviks) won. Sensing that, the UNR allied itself with Poland and because of that Ukraine lost some territory as most of Ukraine became part of Soviet Russia.
During World War II many Ukrainians welcomed the invading Germans as liberators. The Germans disagreed and treated the Ukrainians as not worthy of self-rule. In response the UPA (Ukrainian Insurgent Army) formed in 1943 to fight both Germans and Soviets. After 1945 the UPA received some recognition, but little support, from the West and ruthless efforts by the Soviets eliminated the UPA by 1955. Russia did manage to convince the new UN (United Nations) that Ukraine was eligible to be a member of the UN. This gave Russia an additional vote in the UN general assembly, much to the disgust of most Ukrainians.
This violent history with Russia and the Soviet Union played a major role in Ukraine (and Belarus) insisting on independence when the Soviet Union fell apart in 1991. Many Russians saw this Ukrainian independence as a temporary condition, something they went war over in 2022.