The function reference for wp_schedule_event provides code examples for creating a plugin using WordPress’ “Cron” or scheduling functionality.
Hopefully this saves someone the few minutes it took for me to find this – pretty much everything you need to know!