Taking a break while coding?

I have been coding for quite some number of months now, sometimes - I feel like giving up coding but I really have interest in it. Is it a good choice to take a long break?
Taking a break should last for how long, a week, 2 weeks or months?

I’m kind of confused about this because I don’t really know when to take break while coding.

I take many breaks, and I often find myself thinking about wanting to get back to the computer and so I keep practicing. Sometimes I feel like quitting, but I eventually keep moving forward.
If you’re going to take a break, find another interest. I don’t recommend wasting it watching your favorite Netflix show.

I took very long breaks in the last ten years, which I wish undone those breaks. If you have a real interest in it, the break that you are going to take shouldn’t be more than a week or two. Because eventually, you come back sooner or later.