Changing 2D collider to 3D

hi, im making a code setting if i touch a collider it do something
i was using a code with 2D but now i need it to be in 3D

my code when im using in 2D is

	if (Input.touchCount == 1) {
			Touch touch = Input.GetTouch(0);
			if (Input.touchCount == 1  && touch.phase == TouchPhase.Began)
			{
				Vector3 wp = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position);
				Vector2 touchPos = new Vector2(wp.x, wp.y);
				if (GetComponent<Collider2D>() == Physics2D.OverlapPoint(touchPos)){
					
					//Do Something
					
				}
			}
       }

now i want it to be in 3D touching a Sphere
and i change the code as following

if (Input.touchCount == 1) {
			Touch touch = Input.GetTouch(0);
			if (Input.touchCount == 1  && touch.phase == TouchPhase.Stationary)
			{
				Vector3 wp = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position);
				Vector3 touchPos = new Vector3(wp.x, wp.y, 0);
				if (GetComponent<Collider>() == Physics.OverlapSphere(touchPos,0.5f)){
					//Do Something
				}
			}
       }

but it comes with error CS0019: Operator ‘==’ cannot be the applied to operands of type ‘UnityEngine.Collider’ and ‘UnityEngine.Collider

i have no idea what should i change or how should i change in order to detect the touch collision in 3D
please someone can help me

For 2D setup you want you function that call back to be named: OnCollisionEnter2D(col : Collider2D);
In a 3D setup you want your function named: OnCollisionEnter(col : Collider);

The difference is in 2D you append a 2D onto the function callback and also the variable name Collider.
In your source code I noticed you tried to use a Collider2D as a Collider. These are two different classes.