where to put return and break conditions

I know that break; is for ending a loop early,
and return; is for finishing a function early and returning a value

I have an instance in the middle of a function where I am comparing 20 values and if any 2 of them meet the conditions I want to finish the comparisons and go to the next step.

Should I do a loop of only one length using break;?
If I did a function it would have 20 variables which seems impractical.
is there a different solution?

So I imagine your doing your comparisons in a for loop or foreach loop? If so you need to break out of that loop and whatever else is in the function can continue to run.

An example:

int x = 4;

for (int i = 0; i < 10; i++)
{
    if (i == x)
    {
        Debug.log("I is equal to x with the value of: " + i);
        break;
    }
}
// do other code here