I am the queen of procrastination and I have been in you position so I completely understand how upset and scared and angry at yourself you are.
First things first make a cuppa and try to relax (better said than done). Take 5 minutes to yourself, eat something that won't make you feel sick and take a shower/walk/yoga/etc. to calm your mind.
Then make a fresh cuppa and sit down with the module handbook. Look at the mark scheme and at the weightings of each section. You'll want to focus your time on the most heavily weighted sections to get the maximum amount of marks possible. Also look at any tips they've given - if it says to write in pt12 and single sided don't lose silly marks by not doing this!!
Write a dissertation outline. i.e abstract, into, methods, results, conclusion, discussion. Do the research and write the results in, then write the intro and ensure you've explained everything you've covered in your research. After that go back to conclusion + discussion - make sure to refer to other research (extra from the intro) and what your findings mean to the wider context.
Fill in the gaps ie. methods, etc.
Use the website 'cite this for me' - absolute lifesaver and does all the citations/referencing for you to save time. Just remember that the bibliography expires after so long so make sure you save it into your dissertation every day.
Get other people to read over sections for you - better if it's someone who doesn't know the topic - to check for spelling/grammar/etc.
Just plug away at it every day and you'll be fine - 3 weeks is a long time. Just don't self-sabotage i.e. watch netflix for 5 hours cause you think you're gonna fail anyway. Cause if you do that it definitely won't get done!!
Good luck - you can do it!!!!