My laptop when I turn it on it flashes for about 30 seconds then it turned of bye itself

Greetings Leahpickersgill:

1) What's the name of your laptop?
2) How old is it (approx.)?
3) What operating system do you use?
4) What do you see in those 30 seconds - any error messages or a start-up screen?
5) How long has this been a problem - have you done anything out of the ordinary recently?
6) Do you have any kind of peripheral connected to your laptop, e.g. a USB stick or a DVD in the optical drive?

First reaction: This sounds like a virus that forces your laptop into endless reboot or shut-down mode. But we need more information on your system.

Kind regards,
GreyCatz