While it is theoretically possible to develop an attitude to totally prevent sadness, the Jewish view is there are times when such feelings are appropriate.
For example, we have an obligation to cry over the death of another person. Also, we should care enough about potential suffering to pray that it will not come. And we utilize these situations as reminders to improve ourselves.
-Sources: from Chochmah Umussar, vol.2, p.203; Rabbi Zelig Pliskin’s Gateway to Happiness, p.172