How do I deal with feelings of sadness and of loneliness during the day?

See below. We all might feel sad and lonely.Are these new feelings? Why are you feeling sad and lonely only during the day? What's happening? What's happening when you don't feel sad and lonely? If you're not employed, keep yourself occupied, hobbies? Volunteer maybe? Or part-time employment? If you're at work and that's happening, then re-evaluate your job.
DEPRESSION. Get an evaluation from a psychiatrist to help identify what depression means to you and whatever else may be bothering you. Consider recommendations for medication if any are given. Get a referral for a reputable psychotherapist to speak with. Meds and therapy combined are most optimal; no just one or the other.
Stay active. Exercise is a great way to relieve stress. Your body releases endorphins during exercise, which can help you feel calm. If you exercise 30 - 60 minutes a day, your stress levels can improve. When stressed, take 5 slow, deep breaths with your eyes closed, then roll your shoulders forward 5 times, then back 5 times. This will slow your heart rate and release tension in your neck and shoulders.