Same as you talk to players: with the
Tell,
Ask, or
Say
commands.
BUT, few NPCs will respond.
They're not that smart. Or they don't speak your language, or something.
Depends.
Largely on what our world authors want them to do.
Of course, chatterbots such as Eliza or Oscar will be happy to yack away with you.
Run-of-the-mill NPCs such as pigeons probably won't.