First off, that you spent six years of your life pursuing your passion shows tenacity. That you knew when to cut your losses shows good sense. I know it's disappointing that things didn't work out, but there's nothing to be ashamed of in failing to start a career as a novelist. It's a brutally hard and arbitrary industry, and any worthwhile employer should be able to recognize that.
Now, you've taken some good first steps in shoring up your technical skills. Go over the usual interview prep books (Cracking the Coding Interview, Programming Pearls, etc.) and start applying to entry-level jobs. See if you have any friends in SE roles that might be able to get you an "in" at their companies. If your university has a solid alumni network, it might be fruitful to reach out to someone in your class. If you had a good relationship with any of your former CS professors, they would be a good resource, too.
Also, it might be a good idea to talk to a counselor, a therapist, or even a family member or friend re: your self-confidence. There's no shame in reaching out to others for help when you're down. Your technical skills will return and even improve with practice, so it would be worthwhile to start a toy project, contribute to an open source project, or even just do some practice challenges on prep sites (eg. HackerRank, LeetCode, etc.).
Best of luck!