Deaf people getting cochlear implants

If someone is born deaf and doesn’t hear their whole life, but gets cochlear implants and can suddenly hear, how do they know what words mean? Like obviously they’re not stupid and they can read, and they know what words mean but they technically have no idea how words sound. I think it would be like hearing in a foreign language until they learned it? Lip reading their whole lives would also play a factor, but does anyone know how this works?