template_preprocess custom block type
you can utilize twig's if/else condition:


Find the twig's template file for your custom block using twig debug mode
use twig's if/else syntax (reference)


{% if field_NAME_OF_YOUR_SECOND_FIELD.0 == false %}
    {{ field_NAME_OF_YOUR_FIRST_FIELD.0 }}
{% endif %}


check this for extracting the values of different fields