Unfortunately, TYLER645 is right. If your 3DS shuts off a split second after you turn it on, and the battery is not extremely low on power, then your 3DS will definitely need to be repaired.
Call Nintendo (at 1-800-255-3700, open 6am to 7pm, 7 days a week), or contact them via their webform, and they will be able to set up a repair for you.
As TYLER645 and NINTEN94 said, The only was to repair it is to send it in. There really is no DIY solution for it and even if there was, I would'nt try it while the console is under warranty. Send it in and you will thank yourself later (~2 weeks) when you get a hopefully 100% working 3ds back.