Yes you will need to get a visa. There are many visa options available to you. H1B is just one of them and the most popular one for getting a visa via work sponsorship.
Looking back at my time in London to be paid well you need to avoid being a permanent employee and work as a contractor, but not all software engineer roles are in demand as a contractor so choose something that there is :-) A good contract in the city will make you a lot of money :-)
Of course with Covid, I am not sure how things will change so you may want to wait for a post covid era before deciding to move.
Of course this my personal opinion from my experience of making the move and my knowledge of London work life is based on my experience from when I lived there. Hope you will find my comments helpful.
On a side note, you may want to explore remote opportunities with companies outside the UK as so many have moved to that model.