I'm a college student and my bike is part of my daily commute to class. However, last semester my bike began squeaking and the squeak got louder and louder as time went on. I tried spraying some WD-40 on the crank-shaft, but this was only a temporary fix. Is there a better way to get rid of the squeaking sound than spraying WD-40 every couple of days?
If spraying a light oil onto the crankshaft temporarily relieves the problem, that suggests that it's the bottom bracket (a really poor name given to the crank bearings and shaft assembly to which the pedal cranks attach). The shaft, by the way, is also called a "spindle". The oil seeps along the spindle into the bottom bracket, and provides some temporary relief to bearings that are dried out and perhaps rusted out. The fact that the oil is able to seep in there shows that the bottom bracket seals have failed; what your penetrating oil is doing now, water and dirt have already been doing for some time.
On most modern bicycles of reasonable quality, the bottom bracket is a single, sealed cartridge unit. Or rather, a cartridge that screws into the "bottom bracket shell" (the cylindrical space in the bicycle frame) from the drive side, and mates with second part that is screwed in from the left side and is opposite-threaded, which gives the bracket proper alignment and stability. Replacing the bottom bracket is a simple, common maintenance task. Bottom bracket cartridges range in price, and can be obtained for well under $100 USD. (Lightly googling, I see some for even less than $20 USD.) The important parameters of the bottom bracket are not only its thread diameter, obviously, but the length of the spindle: you want to match your old one closely.
Cartridge bottom brackets are not maintained. You don't open them to re-pack with grease or replace anything. When they "go", they are simply discarded and replaced. Non-cartridge bottom brackets that are maintainable cannot be lubricated with WD-40. The oil contained in WD-40 is too thin for drive shaft bearings; they require a heavy axle grease which can stay between two parts being pressed together with a great force. Light "machine oil" is for fast-moving parts that make only a light contact together. Bicycles have few, if any, areas for which a light oil is the best lubricant. WD-40 might be okay for, the threads the barrel adjusters on brake and shifter cables. Most things that move on a bike are fairly heavy duty and call for something with body. Also, one problem with light oils is that rain tends to rinse them away.
Changing a bottom bracket cartridge is very easy. I would say that it's easier and less fiddly than, say, attaching a derailleur (including the cabling, and fine tuning it). You need some strength, but not as much as for the removal of a stubborn cassette lock-ring, or thread-on freewheel.
You need two specialized tools. Since the cranks have to come off, you need a "crank puller" (actually a pin press) which is a bit that attaches into a threaded receptacle in a pedal crank, and is used to create the pressure against the spindle to detach the crank. You also need a bottom bracket tool to loosen the old bottom bracket cartridge and install the new one. In addition to that you need the right wrench to remove the crank bolts first (removing these bolts is not sufficient to get the cranks off, hence the need for the crank puller to pry the cranks off). You also need a big wrench to turn the bottom bracket tool and crank puller. Some variants of these tools come with integrated wrenches.
Yes, there is a better way. Use a bicycle specific lubricant. You can find them at any bike shop, or in the bicycle section of big box stores. As others have pointed out, WD-40 is not a good lubricant for bicycles.
If lubing the chain doesn't help, you might need to do some further investigation to find out where the squeaking is coming from.
It looks like to me you are using SPD pedals?
I've had issue with the plates/springs that engage the cleat making a creaking noise. A quick cleaning with chain oil and applying grease fixes that, repeat annually.
Also, if you are having a lot of creaking at the bottom bracket bearing... that needs to be fixed quickly as a failed BB can destroy your frame.