How can I redirect page to next page without click automatically?

I want to make users go to next page after 10 seconds not immediately

My code below

<div class="col-md-<?= $col_num ?>">
        <?= $this->Flash->render() ?>

        <?= $this->Form->create(null, ['id' => '']); ?>
        <?= $this->Form->hidden('action', ['value' => 'continue']); ?>
        <?= $this->Form->hidden('page', ['value' => $page + 1]); ?>
        <?= $this->Form->button(__('Click here to continue - Step (1/2)'), ['class' => 'btn btn-primary',]); ?>
        <?= $this->Form->end() ?>
    </div>


Go to next page immediately ( code )


<script>
var buttonElement = document.querySelector('.btn.btn-primary');
if (buttonElement) {
    buttonElement.click();
}
</script>