Database query with like condition
According to  Drupal db_like doc page

Get a database connection injected into your service from the
container and call escapeLike() on it.

For example,
$injected_database-&gt;escapeLike($string);

Try something like:
$database = \Drupal::database();
$result = $database-&gt;select('table_name', 't')
    -&gt;fields('t', ['field_1', 'field_2'])
    -&gt;condition('field_1', &quot;%&quot; . $database-&gt;escapeLike($string) . &quot;%&quot;, 'LIKE')
    -&gt;execute()
    -&gt;fetchAll();

Read Database api in Drupal 8 for a better understanding of database query in drupal 8.