How can an extension schedule a cron job with a crontab.xml file?

Examples from the core:

1. A cron job for cleaning old cache resources

2. A cron job for deleting unnecessary logged attempts

3. A cron job for deleting expired captcha images

4. A cron job for adding products to changes list with price which depends on date

5. A cron job for deleting all product flat tables for not existing stores

See also: