How to focus on a single area during PhD?
The main point of a PhD is to learn how to be a scientist. Involved in this is to focus on the work that needs to be done but also to pick up the necessary skill to solve the problem. As an advisor, I would get nervous if a student kept moving into new areas without a plan as to what these would be useful for. So from that perspective, if a student made good progress on the research, diversions would not be a concern; without progress, it would be a problem. Where you stand in this is not for anyone to say except based on a discussion between you and your advisor.

During my own PhD, I spent a fair amount learning tools that were only of marginal use in my own work. I am now very happy I did because as now a long-time faculty member, I have come to realize that the time I had as a PhD student to immerse in topics, is hard if not impossible to recreate after the PhD. I therefore advise PhD students to use their time wisely since the tools they learn during their PhD make up the core of their future toolbox. Contacts with other researchers and research directions is a similar issue in my mind. BUT, I always had in my mind that I needed to show progress and stay with my own research tasks as a priority. Balancing between the core work and forays into other areas is a necessity.

From your question, it does not sound as if you have a good balance and I therefore think you need to discuss the thesis work more with your advisor to make sure it is clear and structured to you. Only then will you be able to see your won progress and judge when you are on track.