There were more threats in whole universe and universe is not small. So she was busy to defend the universe.

The events of Endgame was very sudden (at least the fight with Thanos and army), The Avengers had not anticipated the attack. And hence, most probably Carol was trying look after a very large part of the universe, which did not have the Avengers to go to.

The events in endgame took at a faster rate and also there was no way she could have known about what was happening on earth as she was somewhere in distant universe…..only way to contact her was to send emergency signal which was later on sent by fury

The galaxy is big!

She was fighting other people