First, type the command /tour to see a list of all tours going across the whole of PS!. For example, it should be something like this:
tournaments: [Gen 8] Monotype Single Elimination (Started)
franais: [Gen 8] Random Battle Single Elimination (Started)
vgc: [Gen 8] Monotype Random Battle Single Elimination
toursplaza: [Gen 8] Metronome Battle Single Elimination (Started)
You can't join the tours which have already began. Go to the room in which you need to join the tour, and click the "Join" button or type /tour join in chat. After that, all you need is to wait for the tour to start, after which you can see the bracket list of the tour along with your opponent's name. Then, you can proceed to play each round until you went to the tour finals, depending on the tour type (single elimination or double elimination, round robin, etc.)
Also, this Smogon article explains how each tour functions, and read it for more information.
The following Smogon link contains details of every Smogon tour going on their website. It's more complex in Smogon tours—you don't simply join the tour by clicking "Join". Instead, you have to read the OP carefully, and it contains all the details of how to participate in tour. For example, in most Seasonal tours you join by replying "In". For example:
Post 'in' to participate.
That is all you need to know for joining Smogon and PS! room tours. Hope this helps!