First of all you need to make sure about cables and connectors. are they properly connected. if they are connected properly but still you are having same problem then it might be problem with your monitor or graphics.
I think, you have not optimize your computer since long time. so in this situation you have to follow these options then your problem will be fixed. 1. Please uninstall all third party programs from your computer. that you are not using. 2. now you need to delete all temp files from your computer and reset your browsers on your computer . 3. now you need to clean disk and then you need to run an good antivirus. so if there will be any virus then it will remove it. now you need to restart your computer and check it will start working fine. if it is not working fine, then you might have to expand your ram on your computer.