Surprisingly, there is no law declaring English the official language of the UK.
In fact, English is just the de facto official language of the UK, which means it is not legally sanctioned as official but spoken by the majority.
England and Scotland do not have any official languages. Northern Ireland’s official languages are English and Irish.
A good addendum to this is that the recognition of Irish as an official language in Northern Ireland only happened last year (may, 2022) with the passing of the The Identity and Language (Northern Ireland) Bill