To write Key A and Key B onto a WS1850S, connect the device to your PC and use compatible software. Place the MIFARE card on the reader, authenticate the target sector using the default key, and access the sector trailer block. Input your new Key A, access bits, and Key B in the correct format. Write the data, verify authentication with new keys, and ensure access settings are not misconfigured.