I have picked up another panel at CONvergence from Lyda Morehouse, who wanted to drop off it. It's on writing career setbacks and how you deal with them. I used to do a panel at Minicon titled "Psychological Survival for Science Fiction Writers," but gave it up after a couple of people told me they had left the room in tears. No one wants to hear how difficult a writing career can be. So I actually have an idea of the things I want to say.
Mostly, decide what you want out of writing, and then use that as a measure. Do you want self-satisfaction, pro sales, critical acclaim, a cult following, vast fame, pots of money,? If you discover you can't get what you want, consider modifying your goals. Goals should be a stretch, but they shouldn't be impossible.
Take care of yourself: exercise, eat well, avoid illegal drugs and large amounts of alcohol. If you feel depressed, see a doctor. There are medications that can help.
Find good friends and readers and listen to them. People who don't listen rarely become good writers. (Emily Dickinson did, but she is a special case.) Join a writing group. Most important of all, celebrate every good thing that happens: a good panel, a sale, a good review, a person coming up to you and mumbling, "I liked your story." One of the the best things about the Wyrdsmiths, my writing group, is that every time something good happens in your writing career, you have to buy coffee for the rest of the group. This forces even dour people like me to celebrate.
Life is short, and writing is often difficult. Celebrate everything you can.
Find things in your life that give you pleasure other than being on the New York Times bestseller list. You shouldn't rely on a single thing for happiness.