what you need is totally depending on what your switching, sensor, and when all this happens but the basic idea is
gather data from sensor (usually in digital format, but not always) when it reaches the threshold have the arduino switch a pin on, that triggers a transistor / fet / relay to switch the load