Step 1: Sign into https://portal.office.com/ and navigate to OneDrive
Step 2: Locate the file or folder in OneDrive.
Step 3: Right-click on the folder and click on Copy link.
Step 4: Click on Anyone with the link can edit then enter the password in the Password field.
Step 5: Click on Apply button.