Ukraine never had the military equipment and training in using them yet to fight the terrain in the East, that's why they strategically focus all their attention on defending Kyiv since they knew this required Russian troops to be sent to fight an urban warfare and were more military trained after what Putin did to their country 8 years earlier compared to the inexperience Russian conscripts.
The US had to do send their troops in Iraq as well and were able to succeed as they actually have groups of militant who appose Saddam's rein and assisted them in these urban warfare so they were able to take the capital from within. Ukraine then held strong in Mariupol for months of bombardments allowing them to prepare and trained them with the arrival of these military equipment and then launch a counter offensive which has been the most successful in modern warfare to push the Russian troops back and eventually out of Kherson.