For short-term happiness (or at the very least, something to keep the depressing thoughts away) seek quick gratification and minor distractions. Occupy yourself with something you enjoy doing. Start trying to learn a hobby that you might currently be stuffty at like drawing or making music. Pick up a couple books, or find reading material on the internet. Watch movies and take a walk around your town/city/country.
All the while, start looking inward to find the root cause of what's making you feel depressed or lonely. I'm not going to tell you to walk outside and make friends because finding friends is hard for a lot of people. If you're not too occupied with school, maybe think about getting a part-time job so you can accomplish something without having to feel guilty about it later. Plus, like people said, coworkers are the easiest to make friends with.
And lastly try not to over-think your feelings or your situation. Try to force yourself to be content with what you have or lower your expectations so mildly pleasant things may seem like a bigger surprise. One last bit is to try talking to other people about how you feel if you don't, it may sound gay but it might help a lot.