Until WWII the main theme of British foreign politics, directly or indirectly, was expanding or defending the Empire.
At some time during WWII, starting with the fall of France in 1940 and completed with the fall of Singapore and Tobruk in 1942, it changed into a global fight against Nazism/Facism (and later Communism), but where Britain only played a secondary role.
In this fight in you could say that Britain de facto sacrificed her Empire in a process where USA was most "helpful".
If Britain should have pursued an Imperial policy she should have made peace with Hitler in 1940 - ie Hitler get Europe, but we keep the Empire - that would have been quite like what Britain did with Napoleon, when he was strongest, but Churchill and nobody really believing Hitler anymore prevented that. Churchill at that time probably hadn't thought about sacrificing the Empire, but British military disasters in 1941 and 1942 set the path.
It started with the failure to throw the Axis out of North Africa in 1941, which kept Italy in the war and prevented the Med as being the lifeline to SEA and India. As long as Singapore was on British hands you would still have good options for defending the European positions in SEA and thereafter taking the offensive vs. Japan, but that was of course changed by Singapores humiliating fall in Feburary 1942 and just to ram home the point - the fall of Tobruk a few weeks later.
After this Britain really didn't have any realistic option for pursuing her own interests any longer, but had to rely more and more on persuading USA to be as pro-British as possible. Inside the context of fighting the Axis USA was as altruistic as can be expected of a Great/coming Super Power, and probably was served well by British strategic advice (Alanbrooke is IMHO is among the most important persons in recent human history), but USA had never promised to save the Empire - but probably made it a little easier for the British to give up, as they could expect a close relative to take over. Better let the Americans take over than the French, Germans or Russians!
If someone hadn't understood it in 1945 it was all made clear in 1956, when Britain and France tried to defend their overseas interests by preventing Nasser from taking control over the Suez canal - and used pulled away the carpet under the British and French.
The British officially gave up anything east of Suez and soon after also her African colonies. Nasser didn't really become a friend of America - to put it mildly - and in the decades after the Americans for serious started to pay for taking over global leadership - WWII was only the starting fee.
At the end of the day I find it difficult to defend colonial Empires, but a historian like Nial Fergusson IMHO has a point when claiming that colonialism, especially in Africa, probably was abolished some decades too early, Where the British stayed for longest and most intense, like India and Malaya, they left a pretty substantial infrastructure and the former colonies had a decent chance of taking care of themselves. In contrast Africa was left with little more than sergents in the former colonial armies elevating themselves to rulers after 1960.
Nothing could have saved the Empires by 1956 (India was gone already BTW), and even if Hitler had bogged down in 1940 and "been taken care of" it would have taken substantial political reforms to keep them together and transform into some kind of Commonwealth - but they would have had intact economical ties - which if continued and not broken - would have made the world look very much different today.