The first is mechanical and belongs to full-size SD cards only. The slider on the card's edge does nothing inside the card; it is a notch that a lever in the slot feels, and the host decides from the lever's position whether to allow writes. A slider knocked down in a bag locks the card; a slider that has broken off, or a lever that has bent, locks every card or none. Slide it up, try a different slot, and if the message persists in a known-good reader with the switch up, the cause is elsewhere.
The second belongs to microSD cards in adapters. The adapter has a slider of its own, and SanDisk's note on locked microSD cards says that the switch may slide to the locked position as the card is placed in the host if the adapter lock switch is loose, and that the adapter should be replaced. A microSD card has no switch of its own; try it in a reader with a microSD slot, and if it writes there, the adapter is the fault and the card is fine.
The third belongs to the card. Flash wears out as it is written, and the controller keeps spare blocks to replace the ones that fail. SanDisk's note says the card keeps two copies of its own data on two different blocks and goes into write protection mode when corruption occurs on both, and that the drive will write protect itself to prevent data loss when the number of good blocks is lower than the preset threshold. Other makers' controllers do the same without saying so. The lock is in the controller's firmware, it is permanent, and it is set for a reason: the card can no longer promise to keep what it is given. It will still give back what it has, for a while. Copy everything off now, with a reader on a computer, and if the card reads too slowly or drops out, send it and let the bench image it in short passes with the power cycled between them.
The forum fixes are worth a paragraph because they cost time. diskpart's attributes disk clear readonly clears a flag Windows keeps about a disk; it does nothing to a lock the controller set. The registry key under StorageDevicePolicies does the same. The makers' format tools try to rebuild the card's table from scratch and, on a card that has locked itself, fail with Windows was unable to complete the format, which is its own page. None of them unlocks the card, and every attempt powers a card at the end of its life once more.