Here is a re-write of your code, maybe it can help you
System.out.println("Enter receiver's name: ");
String receiversearch=input.nextLine();
Contact foundContact = null; // here we will store the found contact (if any)
for(Contact contactmain:phonebook) {
if (contactmain.getfname().contains(receiversearch)) { // == true is redundant, contains(..) returns a boolean
//receiversearch=phonebook.indexOf(phonebook); //this is wrong and not needed, you can remove this line. Your phonebook items are Contact objects and not String so you cannot assign them to String. Moreover indexOf(phonebook) is wrong, you are trying to get the index of a List instead of an item on the List
foundContact = contactmain; //contact is found assign it to foundContact
break; //break the for loop since we found what we were looking for
}
}
if (foundContact != null) {
System.out.println("Contact has been found!"); // foundContact is not null which means that we have found it
} else {
System.out.println("Contact not found"); // foundContact is null which means that we couldn't find it
}