Edit in JSFiddle

function sumaNumeros() {
  let num1 = 5;
  let num2 = 10;

  document.write(num1 + num2);
}
<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="main.js"></script>
  </head>

  <body onload="sumaNumeros()">

  </body>

</html>