Getting into a good work pattern is very difficult. It's also hard to push yourself to communicate to the level that is required when you are at home. I've been working remotely for the last 5 years (and before that I'd done another 2 year stint a long time ago). WFH days are basically the optimal situation for a programmer I think -- you get some good time to put your head down without distractions. Full time remote can be like sensory deprivation if you don't know how to deal with it.
One of the things that a lot of people used to say before the pandemic was that chatting on Slack is wasting time. However, without something like Slack your productivity can just go down to zero. To be fair, I'm completely happy with IRC. I'm also completely happy with email. But you need to be spending time typing out those thoughts and receiving thoughts from your teammates. It seems counter-productive, but it's really important.
Especially because I'm 9 timezones away from my colleagues it's particularly tough -- there is nobody to chat to when I'm working. So what I do is just start a monologue on IRC. I start a thread (if I'm being kind... sometimes I forget) and I just type what I'm doing: "I've started story X. I ran into problem A, but I fixed it with technique T. Boy this part of the code stinks. What do you guys think about refactoring next time we get a chance? WTH??? How does B work? It just looks borken. Oh... Derp. I figured it out. I thought it did R, but actually it does S".
This makes a massive difference. One thing it does is show your colleagues what you are doing. It also shows them that you are doing something. It also forces you to do something even when you don't feel like it. But it also allows your colleagues to join your monologue and turn it into a dialog (I wonder if it used to be spelled dialogue...). Even if they only type "LOL! I know, right? That code is the worst!" it's enough. Someone has touched you. Someone cares.
In the best cases you get, "Oh wait! You need to do Y when you do that otherwise the data will be corrupt" followed by, "Hey, let's get together in chat and take a look at this together". Because otherwise you get your PR in and people are shitting all over it and you think everybody hates you (and they feel exactly the same way). In the absence of information, the mind imagines a hostile environment. I don't know why, but it just seems to work that way. So if people are not regularly touching minds, then you just end up getting more and more grouchy.
Taking some vacation can help to get your head in a better place, but just make sure that you look at your work situation and realise that you need to change it to make it better. Thinking that you will work harder (or better) and that it will solve the problem is the typical mistake. Once you have a work habit that works for you, it will not be difficult. You do not need to work harder or concetrate better. You need to work differently.
Hope that helps you out. Feel free to email me if you would like other pointers. The way you seem to be feeling is really common and I have a lot of experience with it ;-)