The built-in way
Use a Shortcuts automation (macOS 26)
- Open the Shortcuts app and click Automation in the sidebar, then the + button.
- Choose the Folder trigger, pick Downloads, and set it to run when files are added.
- Add actions that check each file (for example "If" the file extension is "pdf") and "Move" it to a folder.
Shortcuts runs without asking, and there is no undo for what it moved. Test it on a copy of a few files first.