‘Little’ or ‘a little’ is used to talk about uncountable nouns, whereas ‘few’ or ‘a few’ is used to talk about countable nouns. Note that ‘a few’ also means ‘some’, that is more than just ‘few’.
‘Sugar’ is an uncountable noun, i.e., it can’t be counted; therefore, ‘a little’ is used to talk about it. ‘Friend’, on the other hand, is a countable noun, i.e., it can be counted quite easily; therefore, ‘a few’ is used to talk about it. For examples:
My mom has very little patience. (Patience = uncountable noun = little)
There were a few students present in the class today. (Student = countable noun = few)