How to fix disconnected Camera

When I open my camera sometimes it works but most of the times it doesn't. I think that the camera is not attached properly or the connection has gotten lose. What should I do ?

P.S. I have already tried the hp pc hardware diagnostics

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0