If raycast hits object with tag

Hi,

I am inexperienced with ray casting and need some help. as it stands I am trying to make sure that when I click on one game object with a tag “one” it will do one thing, but if it hits andything else it will do another code. I have tryed this a cupple of time now and would like come help.

	if (Physics.Raycast (ray, out hitInfo)) { //sets the layormask on the raycast.
				//if (RaycastHit.collider.gameObject.tag ("one")) {
				// 		do 1 code
				//}
				//else if (RaycastHit.collider.gameObject.tag !== ("one")){
				//     do other code
				//}

im newbe here but i think it should be:
hitInfo.transform.tag == “One”

if(hitInfo.collider.tag == “one”) {

}
else {

}