[Moshe] said to them: "I am a hundred and twenty years old this day; I can no longer go out and come in; and Hashem has said to me: 'You will not pass over this Jordan.' Hashem your God, He will pass over before you, He will destroy these nations from before thee, and you shall dispossess them; and Yehoshua, he will pass over before you, as Hashem has said." (31:2-3)
What does it mean to "go out and come in"? Moshe has just been giving long speeches to the entire people, so it cannot mean that at age 120 he is incapacitated and bedridden!
In fact, we see from many other places in Tanach that "to go out and come in" has a specific meaning: to go out to battle, and to come in from battle. With this understanding, the continuation of our passage follows logically: Moshe cannot go to battle, so Yehoshua and figuratively God will have to lead the conquest of Canaan.
From where do we know that "to go out and come in" generally refers to battle? Here are some sources. The first one is the most explicit.
Kalev ben Yefuneh arguing why he should be the one to conquer and inherit Hevron:
"As my strength was then, so is my strength now, for war, and to go out and to come in." (Yehoshua 14:11)
David fighting the Philistines:
"The Philistine princes went out, and it happened that whenever they went out, David did better than all of Shaul's servants." (Shmuel Alef 18:30)
Shaul stops sending his army to capture/kill David, because he does not know where David has fled to:
"Then David and his roughly 600 men rose and left Keilah, and went wherever they could go. It was told to Shaul that David had fled Keilah, and he stopped going out [after David]." (Shmuel Alef 23:13)
Achish king of Gat explains to David why he must leave the Philistine camp as they go to fight Israel, because the other Philistines think David will betray the Philistine side. Background: David has lived with Achish and launched periodic raids against Amalek, but told Achish that the raids were actually against Israel.
"You have been upright, and your going out and coming in with me in the army is good in my sight; for I have not found evil in you, from the day of your coming to me unto this day. Nevertheless, the [other] lords do not like you. Now go, depart in peace." (Shmuel Alef 29:6-7)
When Shlomo first became king he was not confident in his ability to conduct royal affairs, unlike David his father.
"And now Hashem my God, you have made your servant king in place of David my father, but I am a young lad, I do not know about going out and coming in." (Melachim Alef 3:7)
And last, a well-known verse. This *could* be another example, but it also makes perfect sense even if the subject is not limited to war.
"May Hashem guard your going out and coming in, from now and forever." (Tehilim 121:8)