Two stay ahead of protoss you usually need to 1 up the amount of bases they have and try to delay the third as much as possible. to do this you can send lings to get the cancel or send a small portion of your army to do it. If you are losing to dark templars lately because you don't have detection is build 2 overseers for your army and 1 for your bases. To stop the early push from protoss you might have to delay the third base drones and build some units to defend from it. Roaches and Hydras will work but if you want to do lings instead of hydras it works to. If you see an early stargate built your opponent is more likely to try and send out an oracle if this happpens make sure you have your overlords spaced out at your base to detect it before it hits your mineral line. To stop protoss from warping units in your base you might want to leave some units at home to defend it.

Here's a good build vs a standard protoss (either gate expand, stargate play, even 4gate/cannon cheese) basically it relies on early speed to deny proxy pylons and gateway pushes and hydras because they're good against gateway units, immortals and can shoot over FF's

For protoss its really standard scout during the early stages to determine what kind of opener wether hes going for an all in or not. Then late game try and stay ahead in terms of economy and deny his expansions as much as possible and once u scout go for the counter to his build.