From here:
https://islam.ru/en/content/story/slay-unbelievers-wherever-you-find-them-verse-sword-explained
'The Quran says,
“Slay them wherever you find them…” which abrogates all the peaceful verses in the Quran and lets Muslims kill any non-Muslim they want.'
But...
'This verse commands Muslims to defend their community against idolaters who violated their peace treaty obligations and were waging a war of aggression.
The verse is applicable only to hostile armies and not to non-Muslims in general. We should look at the entire chapter and interpret the verses comprehensively and consistently, rather than taking one verse out of context.
And...
"When the sacred months have passed, then slay the idolaters wherever you find them and capture them and besiege them and sit in wait for them at every place of ambush. But if they should repent, establish prayer, and give charity, let them go on their way. Verily, Allah is Forgiving and Merciful.:
But...
Some scholars referred to this as the “verse of the sword” because it commands the Muslims to defend the community against their enemies, but this is merely the designation of some scholars and it was not labeled as such by the Prophet, his companions, or the early Muslims. The verse allows for hostilities to cease if the idolaters repent from their transgression and become Muslims.
Even if they refuse to accept Islam, the verse immediately following commands peace with any idolater who stops fighting and asks for a covenant of security.