Log messages:

Debug.Log("Message");
Debug.LogWarning("Warning");
Debug.LogError("Error");

Draw a ray:

Debug.DrawRay(
    transform.position,
    transform.forward * 5f,
    Color.red
);

Gizmos:

void OnDrawGizmosSelected()
{
    Gizmos.DrawWireSphere(
        transform.position,
        2f
    );
}