It is extremely simple to get an entity bean object from a database based on the primary key:

public Person getPerson(String personId) {
 Person aPerson = manager.find(Person.class, personId);
 return aPerson;
}

But what if you don't have the primary key, like when you want to log in and you only have the userid and the password?
For this you will need to actually write a query, but do not fear, it is very simple:
public Person getPerson(String userid, String password) {
  if(userid == null || password == null) {
   return null;
  }
  try {
   Query q = manager.createQuery("select p from Person p where p.userid = :uid and p.password = :pass");
   q.setParameter("uid", userid);
   q.setParameter("pass", password);

   Person aPerson = (Person) q.getSingleResult();
    if(aPerson == null) {
     return null;
    }
    return aPerson;
   }
  catch (Exception e) {
   return null;
  }
}