People with locked-in syndrome can hear and understand you, so it’s possible to communicate with them. They can communicate with you via eye movements.
One simple and often-used technique is asking the person to look up to say “yes” and to look down to say “no.” In the long term, assisted technologies can help people with locked-in syndrome communicate.