Im trying to find a component or to make a circuit to switch a dc wire when a sensor is activated and sends a voltage of 12V, like in the image bellow. Thanks in advance.

Im trying to find a component or to make a circuit to switch a dc wire when a sensor is activated and sends a voltage of 12V, like in the image bellow. Thanks in advance.

You could use an analogue comparator and an analogue switch.
Configure the analogue comparator with a refernce voltage of 12V, meaning the output will be 0V when the input is less than 12V. The output will go high when the input reaches or exceeds 12V, this output can be used to toggle the state of an analogue switch. You would probably want a single supply comparator (no negative rail) and you would need to supply it with more than 12V (15 should do), you can use a simple resistor ladder to supply the 12V reference voltage.
Note, it is possible to buy analogue comparators with different input and output supply rails, so your output could drive a 5V switch rather than having to stay the same as whatever VCC you need to accommodate the 12V for the comparator.
EDIT: Realised my answer assumes that the 12V from the sensor is analogue rather than digital. If the 12V from the sensor is digital (is only ever 12V or 0V, nowhere in between) then you only need an analogue switch which can accept a 12V input.
A relay provides a simple solution.

simulate this circuit – Schematic created using CircuitLab
The electrical schematic shows the coil which is energised by the control circuit and the contact which closes when the coil is energised.
Pick a relay with a 12 V DC coil (to suit your sensor) and a contact rating adequate (>=) for both the supply voltage and load current you are switching.