What brand and model memory card is it? Also what camera do you have? Does the card work in a computer?
The "memory card locked" error is generated by the device or the camera there is a tiny switch that senses the position of the slide switch on the card. Maybe that card is not compatable with your camera but we need more info
I've had the little switch escape from the card on 3 different cards over the years. That might be the issue here assuming it's an SD style card . If it's missing there will be a slot on the side of the card near the terminal end. that's roughly 4 mm long (3/16 inch)
Please look at the photos I posted. The "TAB" is the little sliding gizmo ON the side of the memory CARD. This is the mechanical way of locking or unlocking the card to allow data to be manipulated on it. You want it unlocked inside your camera. But that tab also contacts/slightly pushes a small switch sideways inside the camera that lets the camera know the card is unlocked; sometimes the tab is slightly too "short" sideways to push that switch (laterally) properly. Placing a piece of tape over that area--you must look at the photos!!!--is a quick fix that will allow the camera to recognize that the card is unlocked, and can also serve as a quick diagnostic to confirm that the locking problem with your camera is due to the card/switch problem and not to some other (internal) camera defect. Anyway, you have to read the entire thread and study the photos.