To fight against friends, you will have to press X to open the Menu. If you are not connected to the Internet, you will have to press L to do it > then you will have to go down to the 'Poke Portal' and select it. This will allow you to access all the online features of the game. You can trade Pokemon using Link Trade or Surprise Trade. Or you can participate in battles with Link Battle and Battle Stadium.
To organize a battle against your friend, you will have to go to the Link Battle, where you can select the Single Battle, Double Battle or Multi Battle mode. Then you will have to set a link code and invite your friend.
From here you will be able to select the rules of the battle, no matter if the music doesn't match. they can select the rules of the battle and even the background music. Select the team you want to fight with and then start the battle.
The game also allows you to battle anyone online with the Battle Stadium feature. At the time of writing, you can only play Casual Battles, though there are options for Ranked Battles and Online Competitions, which you'll be able to access later.
This is all you need to know about how to battle against friends in Pokemon Scarlet Violeta possible for you.