def find_matching_resource(preview_resource, delivery_entry, search_field):
    """Returns matching resource for a specific field.

    :param preview_resource: Entry from the Preview API to match.
    :param delivery_entry: Entry to search from, from the Delivery API.
    :param search_field: Field in which to search in the delivery entry.
    :return: Entry from the Delivery API or None.
    """

    if not delivery_entry:
        return None

    for delivery_resource in delivery_entry.fields().get(search_field, []):
        if preview_resource.id == delivery_resource.id and (
            delivery_resource.type == 'Entry'
            or delivery_resource.type == 'Asset'
        ):
            return delivery_resource