The Quran tells of the Prophet Jacob, peace be upon him, who lost his son Joseph and then another son, and still said to his remaining sons to go and look, and not to despair of the mercy of Allah, for none despairs of it except the disbelieving. It also says that with hardship comes ease, and repeats it twice. And it promises that whoever fears Allah and trusts Him will have a way out, and will be provided for from where he does not expect.
The Prophet ﷺ taught that Allah says: 'I am as My servant thinks of Me.' This is a statement about hope as a form of worship: to think well of Allah in difficulty is not naive but a sign of faith in His mercy, and in the same hadith Allah says that if a person comes to Him walking He comes to him running. A person who is in a dark place is told that the door of turning to Allah is never closed.
Hope in Islam is not a promise that things will turn out as we want. The Quran also states, in a verse about fighting, a principle that Muslims apply more widely: you may dislike something while it is good for you and like something while it is bad for you, and Allah knows while you do not. Muslims hope for ease in this world, and if not, for a greater reward in the next, where nothing is lost. If hopelessness is heavy and constant, it may be a sign of depression, which is a health matter: please speak to a doctor or someone you trust, and do not carry it alone.