I used to have a problem getting to sleep after using a computer late at night. I thought it was because of the content I was viewing, causing my brain to be over-stimulated. Even when I used the computer for more relaxing activity, e.g. YouTube relaxation music, it still had the same effect.
The problem was because of the blue light being emitted from the computer screen. Blue lights are used in nightclubs to fool the circadian rhythm into thinking it is still day-time, to keep customers feeling wide awake.
I found a program that solved the problem. It is called f.lux. It adapts the colour of your computer display to the time of day. After I installed f.lux, using a computer late at night no longer affected my sleeping. I have been using f.lux for a few years and I would recommend it to anyone who has difficulty sleeping after night-time computer activity.
Of course, if you have insomnia because of anxiety etc. this program will not solve that.