At the start of To Kill a Mockingbird, by Harper Lee, at first Scout has a problem with Walter Cunningham. At school he won't take the teacher's money to buy lunch—we understand that the Cunninghams don't take charity: when Atticus helped the family with some legal, financial matters, Mr. Cunningham paid him back with goods:
...before Mr. Cunningham left he said, "Mr. Finch, I don't know when I'll ever be able to pay you."
"Let that be the least of your worries, Walter," Atticus said...
One morning Jem and I found a load of stovewood in the back yard. Later, a sack of hickory nuts appeared on the back step.
This is the reason Walter won't take money from his teacher. Scout tries to explain this to Miss Caroline:
The Cunninghams never took anything they can't pay back—no church baskets and no scrip stamps. They never took anything off of anybody, they get along on what they have. They don't have much, but they get along on it...You're shamin' him, Miss Caroline. Walter hasn't got a quarter at home to bring you, and you can't use any stovewood.
Miss Caroline takes exception, swats her with a ruler and puts her in the corner. At recess, Scout pounces on him to pay him back for getting her in trouble and making her "start off on the wrong foot" (though she probably does not know what the idiom means).
Jem saves Walter and invites him home for lunch. At lunch he pours syrup all over his food. Scout is punished for making note of it and embarrassing a guest. Scout has not had a great deal of luck with Walter Cunningham, Jr.
Scout and Walter don't become friends, but I think what changes her mind about Walter can be found in something Atticus says and what happens at the trial.
Throughout the novel, Atticus consistently tries to teach his children how to survive peaceably in the world they live in, and endeavors to make them compassionate and tolerant. Atticus tells Scout that to know someone you have to walk in his shoes:
You never really understand a person until you consider things from his point of view...until you climb into his skin and walk around in it.
Atticus is telling Scout how important it is to see things from the perspective of others to better understand them. It makes one more understanding and forgiving. Scout may be able to do as she sees that Walter never did anything to purposely get her in trouble.
When the mob comes to lynch Tom in jail, Scout speaks to Mr. Cunningham about his son Walter, praising him for being such a nice youngster. Her kindness regarding Walter stops the mob in its tracks.
After the Robinson trial, we learn that it was a Cunningham on the jury who stood up for Tom. This would have been a courageous thing to do in Maycomb at this time period. However, Atticus explains that not only will the entire Cunningham clan not take charity, but they are loyal:
...once you earned their respect they were for you tooth and nail. Atticus said he had a feeling...that they left the jail that night with considerable respect for the Finches.
In light of this news, Scout thinks:
I remembered the...occasion when I rushed to young Walter Cunningham's defense. Now I was glad I'd done it.
It was a Cunningham who had stood up against the rest of the jurors, fighting for Tom's acquittal. Jem and Scout are amazed, but Scout now sees the Cunninghams with respect—they may be poor, but they're "good folks." Scout dismisses thoughts of beating him up, and plans to be nicer to Walter in the future.