The .contains() method checks whether a value exists in the list:
ArrayList<String> names = new ArrayList<>();
names.add("Alice");
names.add("Bob");
System.out.println(names.contains("Alice")); // true
System.out.println(names.contains("Eve")); // false
It returns a boolean. Behind the scenes, it walks through the list from start to end, so it runs in time and space.
If you need the position, use .indexOf(). It returns the index of the first match, or if not found:
int pos = names.indexOf("Bob"); // 1
There is also .lastIndexOf(), which searches from the end and returns the index of the last match.