For the third year now, Russia has been attacking Ukraine with all military means (except nuclear), but has not achieved its goals. Because of this, the international authority of Russia and Putin himself has been greatly shaken, and the Kremlin is looking for a way out of this difficult situation. After all, it was originally planned to capture Ukraine in a few days. Now Putin’s efforts are aimed at weakening assistance from other states to Ukraine and waiting for Trump to come to power in the United States. But if the situation does not change in Russia's favor, Putin will be forced to start other wars to divert the attention of his citizens from the failures in Ukraine.
Apparently, such preparations are already underway in parallel. One eloquent fact testifies to the preparation for war with neighboring countries. When Russia started a war against Ukraine, Vladimir Putin signed a special decree according to which Ukrainian citizens could receive Russian citizenship through a simplified procedure. And last December, he signed a similar decree regarding citizens of Kazakhstan and Moldova.
Kazakhstan is now almost openly moving away from Russia, and the Kremlin really doesn’t like this. Therefore, just as at one time, before the attack on Ukraine, Putin stated that Ukraine is an artificially created state and that such a nation as the Ukrainians does not exist, the same thing is now being announced in relation to Kazakhstan. In addition, as in the case of Ukraine, Russia also has claims to the northern territories of Kazakhstan, which were allegedly previously donated by Russia and where ethnic Russians live who will need to be protected.
If Russia does not attack the Baltic countries to measure strength with NATO countries, then an attack on Kazakhstan could lead to a covert or overt war with Turkey. After all, Kazakhstan and Turkey belong to the Turkic peoples and relations between them have recently been growing, including in military terms. The world is really on the threshold of the Third World War and there are a lot of options for starting it now, more than ever.
Perhaps you don't realize it yet, but Ukraine has already lost this war. In hindsight, key events of this war so far were the battles of Bakhmut and Avdiivka. Ukraine lost so many troops trying to prevent Russia from capturing these cities that it's ability to fight on is greatly endangered. Ukraine needs at least 5000000 new recruits and at least half a year to train them, the time Ukraine doesn't have. Even if they will be able to recruit 500k people, this will ruin Ukraine both demographically and economically and it will de-facto cease to exist.
And the failure you mentioned, I don't see it frankly: Russia is moving slowly but steadily, pushing AFU further west. Russians are capturing a small town or two almost every day after the fall of Avdiivka. They have now reached a town of Chasiv Yar, fighting is going on in the streets right now. Realistically, Russians are going to capture it in like days, because AFU don't have resources to defend the city. They even have issues to defend bigger and more strategically important cities like Kharkiv, Slavyansk and Kramatorsk. In Kharkiv, there is no internet, electricity, water. People are leaving en masse, many are trying to relocate to Dnipro. Real estate prices plummeted.
Regarding Kazakhstan, you're right in a way. Kazakhstan, Moldova and Armenia are the latest CIA projects and these countries are actively severing their ties with Russia now. Moldova is rumoured to be annexed by Romania soon, perhaps except two regions: Transnitria and Gagauz. So yeah, things are getting interesting.