Apex has two methods which help you to detect if a record is cloned or not. The following are the sObject methods used to avoid this:
isClone(): It returns true if there is an entity being cloned from something.
Are you interested in learning Salesforce from scratch! Have a look at this interesting video on Salesforce provided by Intellipaat:
getCloneSourceId(): This method is used to return the entity ID from which an object has been cloned. For example: If P is cloned to Q, Q is cloned to R, and R is cloned to S, then Q, R, and S all point to A as their clone source.