Samuel had been the one who anointed Saul as Israel’s first king. He had watched Saul begin his reign with promise, and he had also watched him repeatedly disobey God. Eventually, God told Samuel that He had rejected Saul from being king.

Samuel was devastated.
1 Samuel 15 says Samuel was distressed over Saul and cried out to the LORD all night. After Samuel confronted Saul for the final time, the chapter ends by telling us that Samuel mourned for him.
Then 1 Samuel 16 opens with God asking Samuel a question.
“How long are you going to mourn for Saul, since I have rejected him from reigning over Israel?”
God wasn’t telling Samuel that his grief was wrong. Samuel had good reason to grieve. Saul was someone Samuel had invested in, prayed for, advised, corrected, and watched fail. Israel’s first experiment with having a king had gone terribly wrong.
The question was about how long Samuel was going to remain there.
God followed it immediately with an instruction. Fill your horn with oil and go to Bethlehem. God was sending Samuel to Jesse because He had selected a king from among Jesse’s sons.
Samuel was still mourning the king who had failed while God was already preparing the king who would come next. One by one, Jesse’s sons passed before Samuel. None was the one God had chosen. Finally, they called David in from tending the sheep.
God told Samuel to anoint him.
“How long are you going to mourn for Saul?”
God did not erase what had happened with Saul or tell Samuel that it did not matter. He gave Samuel something else to do.
There was another king to anoint. That king, of course, was David.
1 Samuel 15:10–16:13