An LWC toast is one import and one dispatched event:
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
this.dispatchEvent(
new ShowToastEvent({
title: 'Inspection saved',
message: 'INS-0001 was saved.',
variant: 'success', // info | success | warning | error
mode: 'dismissible' // dismissible | pester | sticky
})
);
It shows a message at the top of the page in Lightning Experience and the Salesforce mobile app. LWR sites need the newer