I am attempting to make an LED matrix such as in this tutorial: http://www.appelsiini.net/2011/how-does-led-matrix-work. Is there any way I can control components being grounded whilst keeping as many of the other GPIO pins free as possible? Any help that could be given would be greatly appreciated.
Reading the Wikipedia link given by @PaulF8080 suggests that it would not be possible to do use the Charlieplexing technique to drive an LED matrix from the GPIO pins as in any multiplexing situation you trade a constant current on a continuous basis for a higher pulsed current on an intermittent (but regular repetitive basis) - the RPi GPIO outputs just can't do this directly for a large number of outputs.
One alternative approach to driving a large number of LEDs is the one which uses only one or a couple of lines to supply serial data to specify how bright each LED (or how bright each colour LED for RGB or WRGB) device should be. For the most economic devices you have the WS8211b devices which only uses a single GPIO line BUT that must be a PWM output pin and has a quite tightly specified serial protocol and precludes the use of the audio output - however there is code for this on the RPI_WS281x GitHub repository.
However it is much, much easier if you use an array of LED devices that uses a separate clock line as well as a data line to implement a serial bus to control them so you are looking for ones that use the APA102 protocol such as these from Adafruit which can be done on the SPI bus - see the "Which addressable RGB LED strips are beginner friendly and Raspberry Pi friendly" question for some more information.