To change the default 6 digit passcode or password to a 4 digit pin in Oppo phones,
Open Settings and click on Face and Passcode.
Then click on Privacy Code > ON to access further options.
Enter your current passcode and then click on Change Privacy Passcode.
Enter your current passcode and then click on Other Enncryption Methods. It is not visible in my screenshot as there is no way to take a screenshot of it.
After clicking Other ENcryption Methods you’ll be able to see options to change it to 4 digit Numeric Passcode and other options.