SOQL:
[SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = {{reocrdID}}]
OR
SELECT Id, (SELECT ContentDocumentId FROM ContentDocumentLinks) FROM {{sObjectAPIName}} Where id = {{recordID}}
On Anonymous window: returns list of files attached with particular record
On Internal VF page controller (without sharing): returns list of files attached with particular record
On Site VF page controller (without sharing): returns empty list
Is there any configuration/access permission needs to be granted for site guest user?