What does the Bible say about having a joyful spirit in times of sadness and grief?

Bible teachings on joyful spirit in sadness