How to reindex indexer programmatically in magento 2?

Just create PHP file under your module’s Cron folder,
A created module like Rbj_Indexing for reference, Create Indexer.php file and call execute() function,

There are two types of method for indexing.

1. Regenerate indexes for all indexers

2. Regenerate indexes for all invalid indexers. This will only regenerate for invalid indexer.