A beaner is used as sort of a derogatory term towards Mexicans but can be used for every Hispanic/Latino. I liked to call it a counterword for when Mexicans call white people "gringos". It can be said as a joke but just make sure the guy you're trying to call beaner ain't a soy boy.
Andres: "aye gringo que puta estas haciendo en mi camioneta ."
Andrew: " watch it beaner, just checking if you got drugs."