How to access custom block content field in Twig (Drupal 10)

I started using custom blocks for reusable content on a website. It turns out twig works a bit different on block content than on paragraphs.

A working example:

<section{{ attributes.addClass(classes) }} style="background-image: url({{ file_url(content.field_hero_image.0['#item'].entity.uri.value) }});">

and another

{% if content.field_link %}
  <a href="{{ content.field_link.0['#url'].toString() }}" class="btn btn-primary btn-orange">{{ content.field_link.0['#title'] }} &gt;</a>
{% endif %}