Don't use low level session_destroy(), use the session manager instead:
\Drupal::service('session_manager')->destroy();
This will remove all session data and the user is logged out, if that's what you want. You still get a warning if there is no session, so you might want to check this first.
A better solution might be to use the symfony Session object
$request = \Drupal::request();
$request->getSession()->clear();
if you have set the session data in the request object or
$_SESSION = [];
if you have used the deprecated $_SESSION superglobal.
Normally you don't destroy the session or clear all session data, because there might be other modules that also use session data. Simply remove session variables in the same place where you have set them.
$request = \Drupal::request();
$session = $request->getSession();
$session->set('mymodule.value', $value);
// remove later when you don't need the value anymore
$session->remove('mymodule.value');
When all modules removed their values the session is destroyed by Drupal automatically (for anonymous users).