PC players can’t officially disable cross-play from the in-game settings.
If you still want to try, open this file:
Documents\Battlefield 6\Settings\PROFSAVE_profile
Add or change this line:
GstGameplay.CrossPlayEnable 0
Save and restart the game.
(This is unofficial and might stop working after updates.)
Many PC players prefer to disable cross-play because controller aim assist on consoles feels too strong, making matches a bit unfair for mouse-and-keyboard users.