JS подключают через script. console.log() — главный инструмент отладки. F12 → Console.
<script> console.log("Привет из JS!"); alert("Это окно alert — не злоупотребляй им."); </script>