This is untrue. Germany cancelled Nordstream II under extreme pressure from the US BEFORE Russia invaded. The US, including top officials like Condoleeza Rice, Trump and Biden have been saying for more than a decade that Russian gas deliveries to Europe are a "problem."
That is one of the reasons (a main one) why the US has been pushing for this war.
Not just BTW, we in Europe are still buying Russian oil and gas, we're just paying more for it through middlemen. Russian income took a dip at first, but has recovered. They're doing great. We in the EU sanctioned ourselves. It is the biggest financial own goal of my not-so-short lifetime.