Many of Shakespeare's plays have a fool or jester as a character. This play is one of them and Feste is the character who playst that role.
Feste's role seems to have two parts. First, he is a clown -- one who keeps things funny. You can see from his name that part of his job is to do this. His name is connected to "festival" and shows that he is supposed to cause there to be fun and celebration.
But he is also supposed to play a role as a wise man, and some say he is the wisest person in the play. His jokes often have a real point to them and they help people to see things more clearly.