I have ADHD too. I've found the best way to lock in. Find music that makes you happy. Plan your work. Get out that white board or paper. Turn off your notifications on teams/slack, close your email and web browser. Only have the editor and the terminal open. Try the pomodoro technique until you can just naturally lock in for lengths of time and work.
“Yes. I now realize my main issue was (is) a paralyzing inability to start tasks. The result was hours of "working" on homework with nothing to show. I would just sit and try to force my brain to think. Inevitably I would be crying at 11pm over incomplete projects.” This is me to a tee. I have literally stayed up till 3am to get an hour’s worth of work done from 3-4am.