Invalid Transaction Detection

Hey! How would you check if the transaction is invalid? In the case of the double-spend or orphaned block. I’m currently using Blockfrost API.