The way Bernard talks in Baldur's Gate 3 is that after getting a certain password, he can have a dialogue. During the dialogue, he can get the corresponding information and help the player complete the task.
The first is that after the player enters the Arcane Tower, he goes to the underground level and reads the book downstairs to match the password.
The first time was to give him a hug, the second time was to give him an item, and then he was left with the last code to start the battle.
Note that you must find all the passwords. After you find all the passwords, you can start matching the passwords.
The robot can be triggered and then completed based on the corresponding information. After completion, the corresponding reward can be obtained.