To auto-trigger builds, make use of webhooks of your source control provider such as GitHub or GitLab. This means that you do not need to check for changes in the code in the Jenkins UI; the build will automatically start with Jenkins once the changes are detected.
How to set it up:
Configuration of the Webhook: You will need to create a webhook in GitHub/GitLab that is pointing to Jenkins using a unique URL endpoint.
Jenkins job configuration: Tell Jenkins to build if it receives a webhook event - push or pull request, for example.
This will easily enable Jenkins to respond in real time to the changes in the code, ensuring that the development process is very smooth and CI/CD-related experience is ensured.