Confused template in configuration.yaml

The new syntax is documented here: https://www.home-assistant.io/integrations/template/#switch

Converting your config above (which TBH looks kinda odd):

configuration.yaml:

template:
  - switch:
      - name: Garage Door 1
        state: "{{ is_state_attr('binary_sensor.garage_1_input', 'sensor_state', 'off') }}"
        turn_on:
          service: switch.toggle
          target:
            device_id: 24b0defe694c887c3b02fbf6cdb9b066
        turn_off:
          service: switch.turn_off
          target:
            device_id: 24b0defe694c887c3b02fbf6cdb9b066
        icon: >
          {% if is_state('binary_sensor.garage_1_input', 'on') %}
            mdi:garage
          {% else %}
            mdi:garage-open
          {% endif %}

      - name: Garage Door 2
        state: "{{ is_state_attr('binary_sensor.garage2_input', 'sensor_state', 'off') }}"
        turn_on:
          service: switch.toggle
          target:
            device_id: 07150b5772ce8095cb7392aa20b0426e
        turn_off:
          service: switch.turn_off
          target:
            device_id: 07150b5772ce8095cb7392aa20b0426e
        icon: >
          {% if is_state('binary_sensor.garage2_input', 'on') %}
            mdi:garage
          {% else %}
            mdi:garage-open
          {% endif %}

If you need more help see the pinned topic about this here: Deprecation of legacy template entities in 2025.12