A search will find channels (including the ones you are part of) and users. You can not search inside private channels.
When you click on a search result, the following can happen:
If the result is a channel, and you already aren’t part of it, you will join that channel;
If the result is a user, you will start a direct message with that user;
You can search the user you want to talk or click on that user’s avatar and click on the Conversation Button.
To search for channels and users, use the search bar under your account box. Alternatively, you can press Ctrl/Cmd + k to access the search bar quickly.
Just start typing and if it is available, the result will start to populate at the sidebar