Origins of Pan-Slavism
Speaking as a (western) Slav, panslavism was indeed a big topic in 19th century politics.
The primary reason for this seems to have been that outside of Russia, most Slavic populations were not in fact in their own nation states, but rather were subjugated by other national groups. This included, for instance, Czechs under Austrian rule, Slovaks under Hungarian rule, Poles under German rule and various Southern Slavs under Turks (and others), et cetera.
It was a desire of a lot of these Slavic nations to have their own nation states, but achieving this on their own seemed unfeasible, which is why the idea of pan-slavism and associated pan-slavic statehood emerged.
Specifically in the modern day Czech Republic, the Czech population was being subjected to a program of germanization since the 17th century. In the 18th century a backlash started in the form of a national revival movement, the aim of which was originally to reconstruct Czech culture. Gradually, though, it also took on political goals of greater autonomy for the Czech kingdom.
From this, two political lines of thought emerged. One was austro-slavist and argued for cooperation with the Austrians in hopes of greater autonomy and eventual federalization; their hopes were slashed with the formation of Austria-Hungary, when Austrians decided to rely on a Hungarian "alliance" instead.
The other line was pan-slavist which argued for cooperation with other slavic nations, foremost of them Russia on account of being the only Slavic nation-state around. This didn't work out very well, as most prominent pan-slavists only remained pan-slavist until they actually visited Russia (Karel Havlíček Borovský is one instance).
By the time the Great War rolled around, both models were thought unfeasible and instead independent nation-states were created after the war.
It is possible that Russia would have politically supported pan-slavism, though it was mostly an internal affair on our end. Anyhow, most pan-slavist sentiment disappeared to political fringes after the fall of communism, for obvious reasons.
Edited to add:
I see I forgot to address the role of pan-slavism in the conflicts you mentioned, so here's an addendum.
Great War
I don't rightly see how pan-slavism could be blamed for starting this war. Most slavic nations where this was a political current were under the rule of their mostly Germanic overlords and didn't get much say in international politics.
It could be argued that Russia supported Serbia against Austria-Hungary because of pan-slavist ideals, and this has certainly been claimed; the problem is, that due to the singular role of Russia in pan-slavist thought, there is no practical difference (from a Russian viewpoint) between pan-slavism and Russian expansionism/expansionst propaganda. Hard to say here, really, but it's highly unlikely that selfless slavic solidarity was Russia's principal motive.
Russian invasion of Ukraine
In the early 20th century, pan-slavist sentiment was not prominent in mainstream politics outside Russia; formation of Slavic nation-states gave most Slavs hope that they could now make it on their own, and mainstream politics had little desire to emulate Soviet Russia. It was kept alive mostly by Communists, who held the Soviet Union up as the paragon of social development and wanted to either follow its example or join it outright.
After the Second World War, Soviet Union staged or sponsored Communist coups in practically half of Europe. Czechoslovak-Soviet (or Polish-Soviet, Hungarian-Soviet, etc) friendship became the official political line that had to be followed under the pain of persecution. An infamous joke describes this rather well:
A Western tourist arrives in Czechoslovakia and goes sightseeing. Having looked around, he finds a local and says to him:
"There's one thing I find fascinating in this country. Everywhere I look, there's some homage to Russia; here's a picture of Lenin, there a statue of Stalin, over there a huge sculpture of a hammer and a sickle. You guys really have to love Russia!"
"Yes," replies the local, "we have to."
In case of Slavic satellite states, the "friendship" propaganda always had a pan-slavic element, and was officially heartily reciprocated. Unofficially, well.
After the fall of Communism, when people were free to express their disgust with the forced friendship, many eagerly did so.
If Putin currently uses pan-slavic rhetoric to justify his invasion of Ukraine, the sentiment is unreciprocated.
The way I heard it, though, the conflict is mostly painted from the Russian side as Russia protecting its nationals (who were transported and made to settle in Ukraine during Soviet times) against Ukrainian neo-nazis or some such; pan-slavic rhetoric would seem at odds with this official line.