Find hobbies and activities that you like as much or even more so than coding then commit to those in some way. Get outdoors if possible and ideally involve other people so that you have some peer pressure forcing you to follow through on the commitments.
Realise that not breaking away from your work will cause burnout and probably already has since you posted this question. In the long term its going to make you less productive and affect your mental health and wellbeing.
If being unable to break away is related to anxiety and stress about your work then attack the problem at the source. Find out where the pressure is coming from and aim to reduce it by talking to your coworkers about issues and changing how you organise your workload. Sometimes I find that something as simple as writing down what I'm thinking about or creating tasks on a todo list will stop recurring thoughts and anxiety.
Importantly realise that you'll feel internal resistance when trying to break your bad habits but make sure to break through that resistance and establish better habits. When you feel an inappropriate urge to work ignore it and focus on something else, every time you get pulled back push yourself in the opposite direction until you break away from it. Reading up on mindfulness will give you some good tools to achieve this.