There is a manufacturer's defect in some of the older DS Lites. When you push on the buttons on the right (especially the B button) on the defective units, the circuit board flexes and eventually, some traces (wires) on the board crack. Once this happens, you will find that occasionally when you push the B button, the unit will power off because the circuit is broken at the point where the crack formed. When you release the button, the circuit closes again, and you can power the unit back on.
Nintendo fixed this defect by putting a plastic support underneath the circuit board where the buttons are to prevent the board from flexing. This fix has been in place on all new DS Lite units for some time, now (probably 2 years, maybe...)
Unfortunately, once this has occurred, the only way to repair the unit is to replace the circuit board in the DS. This is a task that you should not perform on your own. Nintendo can repair the unit for you, but you will have to pay for the repair because the defective units are more than a year old and no longer under warranty.
If you want to send the unit in for repair, you can contact Nintendo at 1-800-255-3700, and they will set up a repair for you, let you know what it will cost, and give you instructions for sending it in.
You also have the option of buying a new DS Lite, DSi or 3DS to replace this one. Or you could live with the problem.