The answer I got in common across different opnions and people talking about discipline is that you have to abandon internet addiction and just "do" the things you need to do even if you don't want it and accept and get used with the disconfort of being tempted.