LED Cube 4x4x4 Transistor Question
In don't know what you mean by 4 "layers".  Layer makes no sense in this context, and a cube has 6 sides, so this doesn't add up.  I'll therefore assume the question is about multiplexing 4 sets of 16 common-cathode LEDs.

Yes, a 2N4401 and many other NPN transistors will work for the low side switch.  You will need one of these for each set of LEDs, which is apparently one set for each of the 4 faces of your strange cube.  The anodes of each position can be tied together since only one set will be on at a time.  This leaves 16 anode connections to switch.  Each of those needs a series resistor so that the current per LED is 20 mA.