It is often difficult to determine any kind of context when studying a Psalm. However, Psalm 63 gives us some help in this matter. It begins by telling us that this is a Psalm of David when he was in the wilderness of Judah. (This is verse 1 in the Hebrew text but is placed as a sort of subtitle on the Psalm in many translations.) This means that this Psalm was probably written during one of the times in his life when David was fleeing form his enemies in the wilderness; either when Saul was pursuing David or when David was feeling the rebellion began by his own son Absalom. Of these two, the second seems the more likely since v. 11 says "the king will rejoice in God" and David was not yet king when Saul was pursuing him.
If this is indeed the context of this Psalm, then it causes us to consider the weight of David's words. David speaks of seeking God earnestly because God's loving-kindness is better than life. David says he will sing the praises of God and that he is satisfied in God. David says all this not while things are good and easy but while his reign as king has just been attacked and is in jeopardy. Everything David has spent his life doing is currently at risk. And all of this because David's very own son is pursuing him and seeks to kill him. It is in that circumstance that David says he clings to God and is confident that God's right hand will uphold him.
Of course, this is the same kind of radical trust in God that Jesus exemplifies for us and calls us to as well when he calls us to take up our own cross and follow him. If we only trust in God when things are good, then that is not trust at all; that is not faith, at least not the faith of Jesus. The faith of Jesus is a faithfulness that extends all the way to the cross, all the way to our own death trusting that God has the power to rescue us even then. To be the people of Jesus is to be a people who seek the Lord's will earnestly even when we are hurting. It is to be a people who pray "not my will but thine be done."