I have 2008 Specialized Rockhopper Comp. I bent my crank arm but can't find the same model online which is a Shimano FC-442/443 crank arm. If I wanted to replace my crankset what could fit onto my bike? I know there is Octalink and square taper but how do I know the difference and what is the right fit.
Don't worry about square taper vs Octalink and finding a crank that will fit the bottom bracket you have in the bike, you are going to have replace the bottom bracket anyway. There are a couple of technical reasons, but you bracket is probably worn out in any case.
If you go with a three-piece crank (older style, cranks are separate from the axle which comes in the bottom bracket cartridge), it's typical to have to replace the BB with the crank, because different cranks require a different axle length to get the correct chainline. See this answer for longer explanation.
If you go with a newer two-piece design (axle is permanently attached to the drive side crank arm), you'll need a different style bottom bracket of course.
I'm guessing the Shimano FC-442 is a 9 speed rear triple crank. Shimano's current lineup only has 3x9 cranks in their Alivio, Acera and Altus groups. You could look for a used crank from a higher but older series (see this table on the Shimano Wikipedia page for and overview of mountain groupsets). You can also look for a crank/BB from manufacturers like FSA.
if you go for Shimano can use the Line Up web page to pick a current crank and select the appropriate bottom bracket.
Don't forget about selecting the correct chainring sizes and crank arm length. Your bike will have an ISO threaded bottom bracket shell; you'll need to know what width it is - either 68 or 73mm. Shimano MTB BBs should fit both but check this.
Remember you'll need to replace the chain and probably the cassette when you replace the crank.
If you want to spend a bit more $$, I'd upgrade to Deore XT 10-spd. Hollowtech is a big upgrade over octalink. https://www.ebay.com/itm/Shimano-Deore-XT-FC-M785-Crankset-Alloy-Bike-175-mm-10-Speed-Double-Hollowtech/264703915667?hash=item3da1953693:g:8tgAAOSwTAhemwY4
Most of these cranksets come with the necessary BB, but if not you'll need the new external BB's.