you would use the teams rest api:
https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http
use the failure flow or add addition notifications:
https://www.sqlshack.com/reporting-and-alerting-on-job-failure-in-sql-server/