Is there a way to iterate and compare elements in two lists without having to use a nested for-loop or while-loop?

I want to check both lists for any duplicate elements between the two lists and remove the duplicate from the second list, but I want to achieve a time complexity that is better than O(N^2), which is what a nested loop would do.

some sorting routines have a little better performance than n^2, but they'd only be useful for long lists.