Can I Put a IF In a IF?!?

Can I Put a IF in A IF? If not How do I do It??

EXAMPLE: If Cursor Is Touching Lever AND ALSO Pressing Action Button(E) Than Play Animation.

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

public class LeverON : MonoBehaviour {
	public GameObject Cursor;
	public GameObject Lever;
	

	void OntriggerEnter (Collider other) {
		
		if (other.CompareTag ("Cursor")) {
			
			Debug.Log("Cursor Has Collided")
			

	
			if(Input.GetButtonDown("Action")) {

			Debug.Log("Play Animation");

			Lever.GetComponent<Animation> ().Play ("LeverOn");



			}


		}
}
}

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

public class LeverON : MonoBehaviour {
   public GameObject Cursor;
   public GameObject Lever;

   // As long as a gameobject stays within the trigger, this will be called over and over
   void OnTriggerStay(Collider other) {
      if(Input.GetButtonDown("Action")) {
         if (other.CompareTag ("Cursor")) {
            Debug.Log("Play Animation");
            Lever.GetComponent<Animation> ().Play ("LeverOn");
         }
      }
   }
}

Yeah that’s perfectly fine. Its just embedded if statements, more than common. I would suggest maybe using

if((other.CompareTag("Cursor")) && (Iput.GetButtonDown("Action"))
{

}

though as its just minor inefficiencies but if that seems to confusing don’t worry about it.