How can I make the status of the LED light follow the status of the relay?

How can I make the LED light follow the status of the relay?

When the relay is turned on (whether through the button on the physical GPIO interface, or through a timing command, or other methods), the LED light will light up, otherwise the LED will go out.

Can use power supply component.

output:
  - platform: gpio
    id: out_relay
    pin:
      number: <relay_pin>
    power_supply: ps_led

power_supply:
  - id: ps_led
    enable_time: 0ms
    keep_on_time: 0ms
    pin: 
      number: <led_pin>