Lost my SD card for my camera. Bought a new one and it says needs to be formated and when I try to format it says it's locked.

Solution
If there's a tiny white dot on the edge of the card, that's a lock switch which is designed to protect your data from being overwritten. Reverse that switch and it should unlock.