Skip to main content

Redirect:

use Drupal\Core\Url;  
use Symfony\Component\HttpFoundation\RedirectResponse;

$url = Url::fromUri('internal:/');  
$response = new RedirectResponse($url->toString());  
$response->send();

Messeges using static service:

\Drupal::messenger()->addStatus($message);

Other equivalents:

addMessage()
addError()
addWarning()

References:

RedirectResponse
Url
Drupal::messenger
MessengerInterface