Multiplexing help

I have a 2x2x2 led cube i made and I am trying to figure out how to write the code, my problem is that i want to set digital pins 0, and 1 as a ground (is that even possible?). I am not using transistors ither, do i have to use them to make my cube work? I hope my question is understandable, thank you. I can post pictures if needed.

when you set a pin high it sources current from the +5 volt supply though the arduino then though your parts to ground when you set a pin low it sinks current from the +5 volt supply though your parts then though the arduino and to ground

there are limitations, you dont want to source or sink 25-30 milliamps, 40ma is the absolute maximum for an individual pin that is stated by the datasheet, but you want some wiggle room for saftey and tolerances (nothing is perfect). This also does not mean you can max out each pin and be ok, the total current for the package is limited to 250ma.

so do you need transistors? That depends on your setup.

you need to limit the current going in or out of the arduino's pins, and limit the current going to the LED's, too much current on either will damage or destroy either part. To limit current on the LED's you usually put a resistor in series with the LED, that may or may not match up with the arduino limits, and if you do match them up you may find your light output to be dimer than expected.

in order to work around that you use transistors, as they typically can handle much greater current (you have one large part acting as a single item vs a single part with thousands if not millions of transistors in it) , and still be switched by a very low current, though the parts count pretty much doubles.

do you have a schematic of what your doing?

I have told you about pins 0 & 1 before, you are best not to use them. There are plenty of other pins to go at.