I did a two month sabbatical once back in 2003. What I ended up doing was spending a good 5 or so hours in the library.

I would get there, and I wanted to start nice and relaxed, so I found a nice quiet corner and read a book for awhile (I chose a couple of Chinese classics during that period, since I was always curious about them and they were really long: Journey to the West and Romance of the Three Kingdoms).

Once I felt I had read enough for the day, usually after about an hour, I'd head to a the ultra quiet area (this was a university library) that had private wooden study cubicles, set up my laptop, and just played around with things.

One important thing I did was I used a laptop where the internet didn't work on it (the wifi card was fried or something). Now it's not too uncommon for a programmer to 'need' to use the internet for something, but you should fight that urge. The way I was able to get around it was because I was really familiar with the software I was using at that point, and it didn't really have a lot of dependencies or moving parts (it was Adobe Flash, I was making Flash games, it's very self-contained), and the rare times I wasn't sure about something, I just made a note of it to look it up when I got home and worked on something else. I downloaded some documentation also that helped me in the moment a few times as well. (I also don't usually waste as much time on my phone as other people, so there have been a few times since where I will look up something I desperately need to know on my phone while keeping my computer disconnected. If the phone will suck you in to other things, though, don't do this).

I also had a playlist of songs on my computer that I played on shuffle, but it was the same 100 or so songs each day, so it was almost like a ritual. I'd heard all of those songs a bunch of times before so they weren't distracting. Most didn't have much in the way of lyrics.

As for what I worked on, I mostly had something in mind already. I had a game that I wanted to rewrite the engine of because it was clunky and acted weird in spots, and I decided to port a game I played a lot in high school on my calculator, so I didn't really have to experiment with the design, I already knew how it worked. Those games became:

* Clock Legends (the rewrite): https://www.newgrounds.com/portal/view/116067

* Squarez (the port): https://www.newgrounds.com/portal/view/91933

I'd stay there until I was satisfied, probably about 3 or 4 hours, then call it a day, and go for a walk and get something to eat. If possible, I would try to do something with friends later that day. This was in my early twenties, so I had several friends who were available and liked to do things even on weeknights.

I've almost never been so productive in any job or time period since, and I credit that sabbatical for a lot of growth in my skills, abilities, and confidence. I'd love to recreate that but it almost doesn't seem possible anymore. Also I have gone through a couple of involuntary sabbaticals since (I was laid off, took 2-3 months to find the next job), but those didn't work anywhere near as well, as I had the growing financial insecurity and constant pressure to find a new job hanging over me.

So for me, the main takeaways are:

1. Put yourself in an environment that relaxes you but can be conducive to being productive.

2. Come up with a routine and a ritual

3. Even though you have a routine, don't force things. Work when you feel ready, and hopefully you'll want to get started because you're working on something fun.

4. Don't let yourself stress about other things in life, especially money. Work on something that excites you and don't make decisions about what to work on only because you think it'll make money.

5. Set up your system so you can disconnect from the internet the entire time. The internet will happily take your whole sabbatical away from you if you let it.

6. Don't try to work on things for a full 8 hours. Put enough time in that you accomplished something for the day, and when you start to feel a bit tired mentally, stop for the day.

7. Walks, especially around or in nature, are incredibly useful to help recharge. Try to get at least a 30 minute walk into your daily routine.

8. Experiment. Do something different with your life than you normally do. You need to knock your brain off the well-worn groove and it won't do that if you're doing the same thing you've always done, just without the job.

Good luck! I really wish I could take a full year off myself. I'm pretty sick of my current job and I've got a bunch of half-finished projects I'd love to polish up. Unfortunately I can't afford to do that. Maybe I can go on another month or two sometime soon, though.