How to fix a computer it turns on and off then back on

I need more than this.

Start with full system specs, maker and model of everything.

If it ever worked, for how long did it work?

If it is a new build, it sounds like either 1) The RAM isn't all the way in the slot, or 2) The RAM is bad.