I've been going through it lately. I got sick, almost died. My dog passed away, may she find the Holy Spirit. I lost my job, I'm approaching my 30s, and my friends and family have all drifted away. This is life at one point or another.
When it comes to suffering, my mind brings me to the Apocryphon of James. Indeed, of all the gnostic or "proto-gnostic" texts, it's the work of James the Just, brother of Jesus, that I come back to when I'm feeling at my lowest. I know not his temptations or sufferings, yet what he writes feels like he knows intimately the afflictions of the flesh and spirit.
(Apocryphon of James) I told him, “Lord, we can obey you if you want us to, because we’ve abandoned our fathers, our mothers, and our villages, and have followed you. So help us not to be tempted by the devil, the evil one.”
In response the Lord said, “What good is it to you if you do the will of the Father, and he doesn’t give it to you as a gift when you’re tempted by Satan? But if you’re oppressed by Satan and persecuted and do (God’s) 5 will, I [say] that he’ll love you, make you my equal, and regard [you] as having become beloved through his forethought by your own choice. So won’t you stop loving the flesh and fear suffering?
I'd like to point out that James doesn't appear to be gnostic in the same way that Mary, John, or Valentinus were. James is quite orthodox, believing in traditional biblical interpretations of Satan, Sin and Temptations, and Jesus as Christ. Yet, where he and Simon Peter are orthodox, the risen Jesus is quite gnostic. So then if these two themselves admit they don't quite understand the teachings of Jesus, why is it that Jesus favors them so? I like to think this lends towards the notion that Jesus both separated his disciples based on their faith, and taught different lessons to different disciples.
Let's look at 2 other gnostic sources that support this:
(Gospel of Thomas saying 12) The disciples said to Jesus, "We know you're going to leave us. Who will lead us then?"
Jesus said to them, "Wherever you are, you'll go to James the Just, for whom heaven and earth came into being."
Here Jesus indicates that in his absence, it's towards his brother James that the disciples should follow. Heaven and Earth in the gnostic interpretation are the material world and heaven above, which are creations designed to entrap the Spirit in a cycle of ignorance and suffering, something that Jesus seems to indicate that James understands above the others. Common depictions of James the Just indicate he might've been physically handicapped, perhaps suffering from chronic pain.
Let's look at the second passage:
(Gospel of Philip) Jesus tricked everyone, because he didn't appear as he was, but he appeared as he could be seen. He appeared to them (in) [all these] (ways): he [appeared] to [the] great as great. He [appeared] to the small as small. He [appeared] [to the] angels as an angel, and to humans as a human. So his Word hid itself from everyone. Some did see him, thinking they were seeing themselves. But when he appeared to his disciples in glory on the mountain, he wasn't small. He became great. Or rather, he made the disciples great so that they would be able to see him as great.
Here, Philip (or perhaps Valentinus) expresses that Jesus would adjust his teachings to whomever he was speaking to. Combining this with Gospel of Thomas saying 13 (Matthew said, "You are like a wise philosopher." Simon Peter said, "You are like a just [Angel/Messanger]") it can be assumed that with his Orthodox disciples he would be speak in terms familiar with Torah or Enoch, while with his Gnostic disciples he would speak in Gnostic terms. When speaking to both, he would craft his teachings to be inclusive to both, and allow them the chance to come to their own conclusions. Indeed, I think this is the reason many gnostic texts prefer depicting the risen Jesus over Jesus in the flesh, because at the time of the crucifixion, many of the disciples and Apostles weren't in complete agreement over who Jesus was and what he was teaching.
This is the Light Side of Gnosticism: The truth is what you make it. Life, purpose, and suffering is a matter of perspective.
So won’t you stop loving the flesh and being afraid of sufferings? Or don’t you know that you haven’t yet been abused, unjustly accused, locked up in prison, illegally condemned, crucified by reason, nor buried in the sand as I myself was by the evil one? Do you dare to spare the flesh, you for whom the Spirit is a surrounding wall? If you consider how long the world existed <before> you, and how long it will exist after you, you’ll find that your life is a single day and your sufferings a single hour. For the good won’t come into the world. So scorn death and take thought for life! Remember my cross and my death, and you’ll live!”
For James, it's clear Jesus is speaking about earthly and heavenly trials. He lists the variety of ways that Jesus suffered in life: abused, accused, imprisoned, condemned, and crucified. He adds one more that is outside the orthodox narrative, being buried in the sand. This is either a reference towards the temptation of Jesus over 40 days and nights, or more interestingly the possibility that James was involved in the body of Jesus disappearing in the Tomb, being buried in an unmarked grave (I have my own theories about the latter, and how it relates to the resurrection). But tangent aside, Jesus according to James emphasizes that we suffer only because we chose to. By saying remember his cross and death, he's reminding James and Peter not to focus on the pain and torment of the crucifixion, but to understand the reason he embraced his fate so willingly.
When you turn to the subject of death, it will teach you about being chosen. Truly I tell you, no one who’s afraid of death will be saved, because the kingdom of God belongs to those who are put to death. Become better than I; be like the child of the Holy Spirit.”
Here Jesus's use of death is different from other Gnostic sources, speaking of the death of the body instead of Soul. The Kingdom of God belongs to those that embrace the fate that God has outlined for them. We are given free will, so that we might choose God's will out of love and not just obedience. Jesus calls upon us not just to follow him, but to embody one's own relationship with the divine. For James and Peter, that meant proclaiming Jesus as the messiah according to Torah, even as it led to their deaths. One doesn't need to have a complete understanding of God's plan for one to play a part, to be chosen.
"Blessings will be on those who have not seen but yet have believed."
"Once again I appeal to you. I am disclosed to you as I am building a house useful to you when you find shelter in it, and it will support your neighbors' house when theirs threatens to collapse."
[...]
"Do not let heaven's kingdom become a desert within you. Do not be proud because of the light that enlightens. Rather, act towards yourselves as I myself have towards you. I have put myself under a curse for you, that you might be saved."