"I assess the power of a will by how much resistance, pain, torture it endures and knows how to turn to its advantage; I do not account the evil and painful character of existence a reproach to it, but hope rather that it will one day be more evil and painful than hitherto –"
"Pain gives of its healing power where we least expect it."
Feeling pain or feeling down is a natural human response to events, external or psychological, that are, well, painful.
While unpleasant, being in pain can help a process of self-clarification and self-knowledge in terms of knowing what one's limits are, what one should be doing with one's time, what people to cultivate as friends, what activities to focus on, what thoughts to entertain and so on.
Of course clinical depression is pain that is in no way obviously helpful but even such a serious illness as that can also help, in the long run, the goal of knowing oneself, even if only as a reminder of how much one can suffer without giving in to the temptation of suicide.
As Heidegger also wrote
"How can we expect to feel cheerfulness if we were to shun sadness?"Though pain and pleasure are often seen as opposites, pain does lead to pleasure (witness the obviously sexually-inspired song by Queen and, more likely than not, its frontman Freddie Mercury, Pain is so Close to Pleasure, or even the sentences by Nietzsche in number 490 of The Will to Power
"Pleasure is a kind of pain", in number 658,
"[All] pleasure includes pain. – If the pleasure is to be very great, the pains must be very protracted and the tension of the bow tremendous"and, in keeping with the topic of sex,
“[In the sexual tickling of the act of coitus] we see displeasure at work as an ingredient of pleasure. It seems, a little hindrance that is overcome and immediately followed by another little hindrance that is again overcome – this game of resistance and victory arouses most strongly that general feeling of superabundant, excessive power that constitutes the essence of pleasure.”Let us not forget (this excerpted) number 318 of The Gay Science either:
"Wisdom in pain. – There is as much wisdom in pain as in pleasure: like pleasure, pain is one of the prime species-preserving forces. If it weren't, it would have perished long ago: that it hurts is no argument against it – it is its essence.")as in sexual intercourse where losing one's virginity for women might be painful initially or men their anal virginity, and the capacity for psychological pain in my opinion does signal the possibility for intense joy, at least in a healthy and relatively balanced individual.
Socrates in Plato's dialogue Phaedo makes such a link between pleasure and pain as being two heads of the same beast, where the feeding of one leads to the satiation of the other, for the lifting of pain is in fact pleasurable and pleasure would be of little moment in one's psyche if the latter was unfamiliar with the experience of pain.
Pain is part and parcel of the human condition and as such has a role to fill in the general advancement and evolution of our species. For the couplet of pain and pleasure helps humans navigate their own paths through life's material and metaphysical expressions.
The following quote by the by the Persian poet Rumi (1207-1273) puts it best, I think:
"God turns you from one feeling to another and teaches by means of opposites so that you will have two wings to fly, not one."