I feel that if you're working multiple muscle groups it's best to pair what are known as "antagonist" muscles together. So if you use a muscle that moves one way, you can go straight into a movement that uses the opposite muscle. Some examples are:
-bench press and rows
-chin ups and military press
it's one of those situations where it actually helps to think of movements, not muscles (push vs pull).
while there's nothing wrong with working chest and shoulders on the same day, there's a bit of overlap between the movements. Bench press and military press for example both heavily involve the anterior delts, so your performance on military press will suffer if you've already benched, and vice versa.
the antagonist muscle training style isn't perfect either, as not all exercises have an obvious opposite. What would you pair with lateral raises, y'know? In that situation it's best just to choose exercises that do no affect each other, so you could pair lateral raises with dumbell curls, or something like that. Leg exercises aren't always the easiest to pair either, and due to leg exercises being so taxing you're best just to have a designated leg workout and not worry about trying to pair legs with anything.
working one muscle group at a time is a fine way to split, and tends to be the preferred training method for physique conscious lifters, although whether or not it is the best way for a beginner to train is the matter of some debate.
Really, you just have to get in the gym and experiment,
Hope I gave you some food for thought there and didn't just overwhelm with a metric tonne of info!