Compaq Presario CQ50 startup/shut down problem


My laptop randomly froze the other day and blue screened which has happened occasionally throughout the years I've owned it and a hard shut down always sorted it out but this time on start up it would go back to normal for a short amount of time and either freeze, blue screen or shut itself off
When I start it up again straight away it lingers on the compaq start up screen for longer than usual and then the black screen with the flashing line at the top left would just flash continuously and I've tried waiting it out but nothing
When I've left the laptop alone for a longer period of time I manage to get back through to my desktop but then it's only a matter of time before it shuts off or blue screens again and it just go around in a cycle

Please help!