This is the core of Situational Awareness (SA)
It’s a skill you build over time with experience but in general you start to get an understanding (based on mission flow) of where planes are, where they came from and where they’re going.
Frankly it’s harder on MP servers where almost everyone is a Lone Wolf and can arrive over the battlespace from anywhere but in a more structured squadron environment where proper tactics are being employed, things will usually make more sense because you’ll have battle lines drawn that clarify where you, your wingman(men) and the bad guys are coming from.
If you find yourself losing SA, consider exiting the fight (if able) and extend back towards home base. Getting the action back out in front of you (instead of all around you) can often help you get your brain around the “big picture.”
Practice, practice, practice!