Fewer is always an adjective.
Use fewer to refer to countable items such as pencils, adults, trees, and computers.
Less can be an adjective or an adverb.
As an adjective, use less ONLY to refer to uncountable items such as ink, sugar, sand, and air.
Note the difference:
Link to exercises on fewer / less.