As @doubleaa said in the comment on the OP.
you do what you can
Source: I got it from this video (which might be a source by itself)
This [view of Joab] is in contradiction to the view held by R. Abba b. Kahana, who said: But for David, Joab would not have succeeded in war; and but for Joab, David could not have devoted himself to [the study of] the Torah, for it is written, And David executed justice and righteousness for all his people, and Joab the son of Zeruiah was over the host: — i.e., why was David able to execute 'justice and righteousness for all his people'? — Because 'Joab was over the host.' And why was 'Joab over the host'? — Because 'David executed justice and righteousness for all his people.'
See also Rashi on the posuk Shmuel 2.8.15 (link for sefaria)
and David administered justice… and Joab the son of Zeruyah was over the host.: David caused Joab to be successful over the host because he executed justice and charity, and Joab caused David to execute justice and charity because he would judge and Joab would enforce and chastise for him. Also, because Joab was engaged in the battles David was not busied with them, and was (lit., his heart was) left free to judge righteously.
Another video of the Lubavicher Rebbe telling Jews in America what they should do when Isreal is at "war"