how to norlmalize rotation if the plane reach the direction

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
[SerializeField] Transform wayPoint;
[SerializeField] float force;
[SerializeField] float rotationForce;
Rigidbody rb;
[SerializeField]float torqueAmount;
[SerializeField] float timeSteerNormal;
[SerializeField] float timeSinceLastTurn;
[SerializeField] float idilizing;
void Start()
{
rb = GetComponent();
}
void FixedUpdate()
{
MoveTo();
}
private void MoveTo()
{
Vector3 direction = wayPoint.position - rb.position;
direction.Normalize();
Vector3 turningAmount = Vector3.Cross(transform.forward , direction);
Debug.Log(turningAmount);
rb.angularVelocity = rotationForce * turningAmount;
rb.velocity = transform.forward * force;
// rb.AddRelativeTorque(new Vector3(0, 0, transform.localPosition.z) -turningAmount.y * torqueAmount);
if(turningAmount.y != 0)
{
transform.Rotate(Vector3.forward * -turningAmount.y * torqueAmount);
}
if(turningAmount.y == 0)
{
transform.Rotate(0,0,0);
}
}
}

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

You also neglected to state your problem clearly enough to get useful help.

Here is how to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

How to understand compiler and other errors and even fix them yourself: