Someone who's hopeless believes that nothing good can happen — a happy ending seems impossible. If you realize there's no way you'll pass your biology class, it's a hopeless situation.
When you're struggling to learn a new language or tackling a difficult task and feeling utterly discouraged, you can say that you're hopeless. In other words, you have no hope that things will work out the way you wish they would. A plan that's doomed to failure is also hopeless, because there's no chance that it'll be successful: "His scheme to save enough money to backpack through Europe is hopeless, because he still hasn't found a job."