I have the same problem, and it's a constant struggle for me. Here are some things I've tried that have at least worked temporarily:
pomodoro technique
bullet journal: specifically keeping a super simple daily log of whatever I had to do or wanted to remember, and migrating tasks at the end of the month
asking for tighter deadlines to add some pressure
writing down a single task I want to finish for the day
listening to specific music or sitting in a specific place to help trigger work mode
making a point to move and work somewhere else if I'm not getting anything done
pair programming, or at least sitting in the same room as other developers to try to stay on task
RescueTime, both to track how productive I am, and to block distracting websites
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have the same problem, and it's a constant struggle for me. Here are some things I've tried that have at least worked temporarily: