Q: How do you get a squirrel to like you?
A: Act like a nut!
Explanation: In English, the word nut can refer to foods such as pistachios, cashews, and walnuts. Squirrels love to eat nuts, especially acorns if there are oak trees nearby.
To act like a nut means to act crazy.
This joke is funny because it plays with two of the meanings of nut: a type of food and to go crazy.
Here you can see an oak tree grow from an acorn: