Someone on Reddit gives me the solution, here is the code:
var z = -1 * normal
var x = normal.cross(Vector3.UP).normalized()
var y = z.rotated(x, -PI/2)
character.rotation_helper.transform.basis = Basis(x, y, z)
The point is getting x by z-up plane
and getting y axis by rotating z around x by -90 degree