You can run ./gradlew wrapper --gradle-version=6.7.1 with the version you need. You can check the exact command on the gradle release page, for example https://docs.gradle.org/6.7.1/release-notes.html
./gradlew wrapper --gradle-version=6.7.1