I test my code not working I checked file name and verified phone number for custom thumbanail.
function myFunction() {
function setThumbnail()
{
YouTube.Thumbnails.set(
videoId= "DfqGVS0_w14",
media_body= DriveApp.getFilesByName('ddp.jpg').next().getThumbnail()
);
}
}