Probably teething or sick. My daughter also did this right before I realized she was sick.
My son goes thru this every other week since he will get sick or teething. They start developing molars at this age (my son just had his 2nd erupt yesterday) so it affects their eating. Just try to be patient and offer him some food/snackevery few hours. If your son/daughter is teething I've noticed soft foods are better like fruit or veggie pouches.
Same, he got sick with a cough so doc told us it was normal for him not to want to eat. But now that he’s not coughing and better he still refuses to eat almost everything. Doc just said to stay consistent with offering. Hopefully this passes.