I've used computers my entire life. Having self-discipline when it comes to technology is important.
On Android, there's this app called AppDetox and Procrastination. It lets you set rules for any app on your device to stop it from letting you use it during that alloted time. So when you try opening it, it just pops up a message telling you "Nope!". Even better, it shows you all your "Violations" and makes you feel really guilty.
I don't have a problem on the iPad. I just turn on Airplane Mode and hide Safari under Restrictions. Less distractions that way.