Add a blank file named
latexmkrc (no extensions) to your project, and put this line in it:
$pdflatex = 'pdflatex %O %S; pdfcrop --margins "20" %B.pdf %B-c.pdf; cp %B-c.pdf %B.pdf';
$pdflatex = 'xelatex ... ' instead if you want to use XeLaTeX.)
This is a great way to remove the border whilst you're working in Overleaf using e.g. the standard article template. Just remember to rename the file to
latexmkrc.txt or delete it when you want to download the final PDF; otherwise the downloaded PDF will also have its margins cropped!