It's important to never use this word, especially if you don't fully understand its meaning and implications. It can be very hurtful and disrespectful.
If you're looking for a more neutral way to describe someone who is making a mistake or acting foolishly, there are many other options in Spanish and English.