How do you constrain a search based upon a related table

I have two datatypes and datatype A is related to datatype B. How can I do a search in datatype A and constrain the search to matching records in datatype B.

You just need to use a Do a Search for expression and include constraints based on the field containing the DatatypeB record. You can then select a specific field of that DatatypeB record (the one you want to use for constraining your search)

I am new to Bubble so while I understand the concept I do not know how to do it. Could you please send a sample of coding if you have one.