Helper template with AND / OR logic

probably easy, but at the moment I have a blockage: I want to define a binary sensor as a helper (IS/IS NOT severe weather) with a series of AND/OR variables in the template (e.g. weather service warning code = xx OR official warning service reports ‘heavy rain’ AND sensor yy reports rain/h > 4mm, etc.).
Does anyone have a reference to a source of information or even a sample code for the template?
Thank you in advance.

Here’s a contrived example that should help:

  - binary_sensor:
      - name: Severe Weather
        state: >
          {{ is_state('sensor.warning_code', '42') or 
             states('') in ['heavy rain', 'heavy snow'] and
             states('sensor.rain_intensity')|float(0) >= 4 }}
        icon: >
          {% if is_state('binary_sensor.severe_weather', 'on') %}
          {% else %}
          {% endif %}

wow - thanks for the quick and detailed response :grinning: :+1: