How to download a file?

Hi! My question is “How we can download a file?”. I tried it with js (ex. download.js) but didn’t work. Do you have any idea about it?