Alert message inside custom function

Alert message inside custom function


how I can show an alert inside the custom function or popup notification?
when I use alert inside the custom function it shows this error. Any solution on how can display alert messages related to a custom function on the record page?