Where can I get music for an ad without infringing rights?
From music libraries with a commercial license, from the platform's own commercial library, or from a composer who writes a track for the video and transfers the rights under a contract. Before publishing, check whether the license covers ads, which platforms and what term, and keep a copy.
More in the guide to music in ad videos.