In hindsight everything is obvious, but it was a close call and there were many moments history could have taken a different route. Sanctions were painful for russia, but so was cutting ties of a lot of industry towards russia in east germany for instance. A bit more cooperation (and maybe less US started wars as a guidance) and all would be quite different.
Thing is, it wasn't hindsight. The US had been warning Europe about the dangers of dependency on Russian energy since at least 2016 through 2-3 administrations (see my other comment for the citations).