HTML:
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Desenhando</title>
<script src="desenho.js"></script>
</head>
<body>
<canvas id="desenho" width="600" height="400"></canvas>
</body>
</html>
JavaScript:
let tela = document.getElementById('desenho');
let pincel = tela.getContext('2d');
pincel.fillRect(0, 0, 600, 400);
pincel.fillStyle = 'lightgrey';