You can check official documentation of Magento for setting up cron jobs. If you require a step by step walkthrough, then here is one: https://magenticians.com/setup-cron-job-magento-2/
Basically, you have to create crontab.xml under app/code/Magenticians/Mymodule/etc
then create Run.php under app/code/Magenticians/Mymodule/Cron
The code you need to enter in these files can be found in the article.