A big one is to just remove the option to be distracted at all.
Use an extension to block time-wasting websites on your browser while working. Keep your phone out of reach. Set breaks and try not to pollute your thoughts during breaks (and try to keep a schedule like Pomadoro or such).