Hey so I have a wheel that I pulled out from storage 3-4 years ago and I was told that I'd have to remove a free wheel cog part and I was wondering if this was true or what exactly the part is and if I could detach a geared cog from an old wheel and put it on this wheel.
What you have is the inner part of a freewheel that was taken apart or broke while still screwed on to the wheel. You need to get this off to use the wheel. Probably the easiest way to do this is to put it in a vise (clamp it where those sort of tear drop shaped cutouts are) and unscrew it. (If you've got the freewheel part facing down in the vise, turn the wheel counter clockwise to unscrew.)
Once that's off, you can put a new/used freewheel onto the wheel and put it back on the bike. Note that taking a complete freewheel off another wheel will require a "freewheel removal tool" of the correct type for that specific freewheel. The "clamp it in the vise" trick only works once the whole freewheel has been taken apart which you don't want to do.
Note finally that most freewheels will work fine. But there is a risk that the new freewheel will be wider than the old one and hit the inside of the frame. There are ways to check before hand or deal with it afterwards, but I won't get in to that unless you ask specifically.