Yelling at my 9 year old son

C: son not willing to finish his work . His teacher is about to come . I need to go pick his siblings from school . I was doing chores for a while and helping him with his online school work . He was playing between sessions .
T : He is acting out and whines not willing to do his work with this particular subject . He is a responsible student otherwise and an adorable easy going nice quiet and pleasant child .
F : frustration and confusion.
A: yelling at him for acting out for a while .
R : He gets scared and agrees to do his work and says he is sorry .