How to calculate if the x value of an GameObject is greater or lower than the x value of znother GameObject?

I want the object I’m attaching the script to to go to move towards +∞ on the x-axis if the x value of the target is greater than the x value of this object and I want it to go towards -∞ on the x-axis if the target’s value is lower.

The problem is that I don’t know how the calculate whether the x value of the target is greater or lower than the x value of the object I’m attaching this script to.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AIMovement : MonoBehaviour
{
    [SerializeField] Vector3 v3Force;
    
    void FixedUpdate()
    {
        if (// the x value of the target is greater than the x value of the object I'm moving )
            GetComponent<Rigidbody>().velocity += v3Force;

        if (// the x value of the target is lower than the x value of the object I'm moving )
            GetComponent<Rigidbody>().velocity -= v3Force;
    }
}

First, you need access to the target transform:

[SerializeField] Transform target; // Assign the value in editor or use some other method that will allow you to get the required transform

After that comparison should not be too hard. You can simply do:

target.position.x > transform.position.x // and target.position.x < transform.position.x