How do I regain my momentum in research after a long period of slacking off? I'm two and a half years into my PhD program. Recently, I finally worked up the courage to admit it — I've been slacking off for over a year and it's my fault. Now I'm determined to be productive in research again but realized that I forgot how to.

It was sweet in the beginning. I got a paper accepted at a top conference after my first semester, which was quite something for a first-year. I was enthusiastic about research back then, devouring papers in and outside my field and conceiving of new research projects even in my dreams. 

Sadly, things changed quickly. At the beginning of my second semester, I took over a project left by a visiting scholar in my lab. That project was complicated and beyond my expertise. I poured hours and hours into it but barely got any useable data. Meanwhile, my own projects began to go nowhere. My advisor didn't offer any concrete help (e.g., giving advice on how to improve my experiment equipment or design, pointing me to people who might be able to help, etc.) but just asked me to keep going. After a streak of failed experiments, I felt disillusioned and started to spend less and less time on research. I spent what must have been 40 hours a week on my hobbies and social activities. I feel ashamed to admit it but even when I was in my office, I wasn't thinking about research — most of the time, I was just randomly browsing the Internet and waiting to go home. I only worked hard before major deadlines and managed to get some papers/posters accepted at major conferences. These achievements, however, paled by comparison in front of those of my cohort. My advisor noticed and mentioned several times that my research is going slowly. 

This semester, I came to the realization that I've squandered half of my PhD career and decided not to continue on the path of self-destruction. I want to make the most of what I have left but feel disoriented about where to begin and what to prioritize. For instance, should I first catch up on basic research skills that I lack or come up with new ideas? Speaking of the latter, what are some good practices I can follow in order to regularly come up with research ideas? — I used to be good at this but have now lost touch with what good (or at least feasible) ideas look like. How mature should an idea be before it's a good time to talk to others about it? Should I ever share my concerns with people in my program? — They may look down upon me and I'm not sure what good it does, but it feels so painful to keep pretending that I'm right on track.

Any suggestions would be much appreciated!!
This may sound stupid, but a good place to start when confronted with a seemingly unsolvable problem is just to start doing something. There are always some simple experiment/simulation one can run, some related papers one can read, or some results that can be written up. The point is to get back to making consistent and incremental progress, no matter how trivial it may seem or how many mistakes you make. Once you get the ball rolling everything else should follow, given your background.

Don't worry too much about coming up with research questions. Good research problems are not dreamed up in a vacuum. You have to immerse yourself in the literature and your research problem to see the gaps that others have overlooked or come up with new methods to tackle old problems. So when you are still trying to get back to speed don't expect brilliant ideas to just pop into your head.

Another thing you should do is to set up weekly meetings with your advisor. Or if your advisor is not available, then write up regular progress report, both for yourself and send it to your advisor. The fact that you can slack off for years and get away with it means that there is a lack of structure and discipline.