How to align floor in horizontal direction in three.js

I’m guessing you are using a planegeometry. You need to rotate it.
Here is some example code.

const floor = new THREE.Mesh(new THREE.PlaneGeometry(10, 10), new THREE.MeshNormalMaterial())
floor.rotateX(-Math.PI / 2)
scene.add(floor)