Navigate to Pages, Records, and Lists
To navigate in Lightning Experience, Experience Builder sites, and the Salesforce mobile app, use the navigation service,
lightning/navigation service is supported only in Lightning Experience, Experience Builder sites, and the Salesforce mobile app. It isn’t supported in other containers, such as Lightning Components for Visualforce, or Lightning Out. This is true even if you access these containers inside Lightning Experience or the Salesforce mobile app.