Take Breaks But Not Too Much Consequtive Time Off.
I recently moved out of state and took about 5 months off coding. When I tried to jump back in I found I'd forgotten a lot of what I learned the first time of starting to code.
Mental breaks are a necessity, but when you first start coding it is not like riding a bike. Continuous practicing is key.
Don't make the mistake I made. At most, take an afternoon or maybe an occasional weekend off as a breather. You'll likely come back to your code refreshed and in a much better place to dive back in.