i use the following code in my themes
<a aria-label="{{ post.name|escape }}" title="{{ post.name|escape }}"
href="{{ post.absolute_url }}"
class="card__image card__image--top card__image--ratio card__image--ratio card__image--ratio-16-9">
{% if post.featured_image %}
<img class="img-fluid w-100"
src="{{ resize_image_url(post.featured_image, 350, 0, 350) }}"
loading="lazy" alt="{{ post.name|escape }}"
width="350">
{% else %}
<img class="img-fluid w-100"
src="{{ resize_image_url(get_asset_url('../images/news.png'), 350, 0, 350) }}"
loading="lazy" alt="{{ post.name|escape }}"
width="350">
{% endif %}
</a>