Don't write alone.
Sure, yeah, you should probably put on some headphones or shut the door so you can bask in the glory of getting lost in your own head... but that's when you're dong the actual writing part. Draft one. It's meant to be done in near or total solitude.
The rest of it, however, is some kind of daydream-nightmare hybrid, and you certainly shouldn't go through that stage by yourself.
I speak from experience. The actual drafting process is my favorite part because I get to crank to volume, usually on some quality dubstep, and ignore every other human on the planet, not to mention the regular stresses of life. It's a time for me to let loose and truly indulge in my creativity because hey, nobody's ever going to read this version. It's a vastly important step, as I'm sure you remember, and a really fun one, too.
But then you'll finish it and hopefully set it aside for a couple weeks, at least, to both commemorate the feeling of accomplishment and forget everything you just wrote. Enjoy this stage, because the joy and confidence in your own skill isn't going to last.
Thus begins the editing stage, which is where I've been as a writer for the past nine months or so. (If you count last July Camp NaNoWriMo, it's more like a year). This is the part where you usually wind up sacrificing your soul in the hopes you'll come up with a real, quality product and then spend the next weeks or months bemoaning said sacrifice. As I'm sure you remember. Quite well. It's simply the writer's way.
However, just because we always drown ourselves in lament over our writing skills, there's no reason for us to go through it alone. Once again speaking from experience, I can affirm that having a fellow writer friend (or several) can be a blessing of unequal measure. These friends are your life line. In that moment when you're sitting in front of your screen, head in your hands trying not to rip out all your hair, you can turn to them.
Not only do they make great sounding boards for when you have an existential crisis, they also make the best beta readers. Writers read a lot--or so they should--and if they read regularly in your genre, they will not only know what to expect, but what to avoid and, as writers, can help you make judgment calls when it comes to revision. My writing friends have assisted me greatly in recognizing some problems with the ending of my novel, and I've used some of their advice to come up with better ways to solve the problems. Without my friends, my own work would be of lesser quality, and that's a debt I don't think I'll ever be able to repay.
Overall, allying yourself with fellow writers is a smart move. These friendships are meaningful and based on actual trust, and they will help grow you as a writer. Plus, criticism is always easier to hear from friends. I am grateful for my writing friends every day, and I hope that if you're a writer, you have at least one writer friend too.