The intersection of two arrays is just the set of elements that appear in both. Convert both arrays to sets to eliminate duplicates and enable fast membership checks.
For each element in the first set, check if it exists in the second set. If yes, include it in the result.
Using sets instead of arrays makes membership checks run in $O(1)$ average time rather than $O(n)$ with arrays.