First: charge it, and do it properly
A completely flat battery is the most harmless cause and also one of the most common. When a battery is very deeply discharged, the iPhone shows nothing at all for the first few minutes on the cable, not even the battery icon.
So plug the device into a charger in a wall socket, not into a laptop or a power bank, and leave it alone for half an hour. Use a cable that you know charges another device. A kinked or cheap cable is the cause more often than you'd think.
If the red battery icon or the Apple logo appears after a while, it was the battery. If this happens to you often, or the device simply switches off while it still has charge left, the battery is worn out. There's more on this in the article on battery replacement.
