Far more than most people realize, mental health, which includes the will to live and to pursue one's goals, is related to physical, social, and spiritual well-being. As the latter two of these are more personal matters, which I invite you to consider as a part of the whole, I will focus my suggestions more on the first of them.
PHYSICAL HEALTH TIPS
Depression, boredom, and malaise all have some similarities, and the following tips can help to overcome them. The relative importance of each one will differ among individuals, depending on their strengths and weaknesses.
Rest: Get on an "early-to-bed, early-to-rise" schedule. One hour of sleep before midnight is worth two afterward. This is because hormones that regulate metabolism are principally produced between the hours of about 9 p.m. and 11 p.m., and only when one is asleep and the lights are off.
It may take some time to adjust to a new sleeping schedule. Do not be quick to give up trying. You may find it easier to sleep at the correct time if you have not taken naps during the day. Naturally, it helps greatly to switch off your internet-connected devices at sleep time, lest they keep you awake.
Exercise: Regular exercise is hugely important. It regulates one's metabolism, moderates the appetite, helps to cleanse toxins from the body, releases and consumes the "stress" hormones (norepinephrine/adrenaline), and improves one's ability to rest well at night. There is no substitute for taking a long walk in the cool of the day and having some time for reflection along with it.
Nutrition: Certain vitamins and minerals are especially important for the health of the nervous system. When one is "burned out," it is often that the brain and nerves are weakened by strain and need some rejuvenation. B-vitamins are near the top of the list, with vitamin B12 being especially valuable. If you choose to find B12 supplements, look for methylcobalamin (the most common form is cyanocobalamin, but this is virtually useless, studies having shown 98% of it is eliminated from the body within 24 hours). It is not possible to overdose on B12.
Healthful fats, including linolenic acid and linoleic acid, are important for good nerve function. The myelin cells that form a sheath surrounding nerve axons are fatty cells. Olive oil, being less processed and more natural, is one of the best sources of oil.
Detoxification: Toxins in the body can hinder normal function and bring on depression or malaise. Avoid them as much as possible, including cigarette smoke, alcohol, mercury (Hg) or its vapors or amalgams (dental fillings), lead (Pb), etc. If you feel this may be a significant source of trouble in your case, a certified toxicologist should be able to assess your body's toxic burden and help develop a plan of therapy to remove the toxins.
Avoid caffeine. Caffeine increases the stress in one's system. It increases blood pressure and heart rate and opens the lungs, making one feel more alert and awake--but at the same time causing the body to function in a sort of "emergency mode" in which energy is borrowed from the future to meet present needs. When the addictive drug is gone, one's energy levels drop below normal. Caffeine is a common ingredient of beverages, including coffee, tea, energy drinks, and many sodas (e.g. Coke and Pepsi).
Sunshine: Sunlight helps the body form vitamin D which is an important hormone with respect to emotional and metabolic health. It is especially important in combating depression. Along with exercise, getting some sun serves to relax the body and induce sleepiness, making one's sleep at night more refreshing.
Water: Everyone knows the importance of water, but few realize how important it is to the brain. At night, when brain cells are less active, they shrink slightly in size, which opens a larger channel between them for the flow of fluids which removes the waste byproducts from their day's activity. Drinking plenty of water helps to cleanse these toxins from the brain, especially at night during sleep. Personally, I have found that a good glass of water before going to bed is worth an hour's sleep, even if it causes me to get up during the night.
Socio-emotional Health: It is important to one's own well-being to feel like a useful, valued part of society. This need cannot be met through self-centric activities; it can only be filled through focusing away from oneself to the needs of others. Find someone to help, someone whom you are able to assist. Whether or not you are thanked, you know that you have done something good and it will boost your own sense of self-worth--but hearing the appreciation for your efforts will really improve your morale.
Unless you know that this time of year is critical to some particular data-collection process in which you are engaged, I would suggest you take anywhere from a week to three weeks as a mini sabbatical during which you focus on your own well-being, in agreement with some or all of the suggestions made above. Give your mind a rest; it will be able to accomplish much, much more when it is refreshed. During this break period, make sure you have some time to reflect--away from the internet, social media, or other distractions.
Once you have had opportunity to put your mind back on track and to reflect on your goals for the future, I think you will be in a better frame of mind to tackle the final steps for finishing your degree. You already sense the wastefulness of all your past efforts if you end up short of your goal. The very fact that you presently seem to have lost your focus is indicative of just how strenuous those past efforts were. Don't let them be for nothing!
You can do it! After a bit of rest, buckle down and finish your work. You will be very glad that you did. Make it a goal to finish early. Once it's behind you, then you can go on to more pleasant things.