This is general information, not legal advice. Rules differ by country and platform.
Songs and recordings are usually owned by someone. Posting a video that includes them can lead to the audio being muted, ads being placed, or the video being removed.
Check the platform's own library
Many platforms offer a library of music that is cleared for use in videos on that platform. These often have restrictions, particularly for business accounts.
Check licence terms for stock music
Read what the licence allows: commercial use, which platforms, and whether you need to credit the artist.
Use your own music or ask permission
If you made it, you can use it. If someone else did, ask for written permission.
When in doubt
Get advice from a lawyer or from the platform's official guidelines.