Struggling with Airdrop contract

If a user transfers tokens to you outside of your contract then your contract does not know where the funds came from. As you will need this information that is not viable which pretty much made the option 1 I posted only useful if it’s from people you trust.

So the only real way is that the user will approve the funds. To do this the user will have to call approve on the token (not your smart contract) with token approve(smart contract address, amount).

After that the user will call your smart contract distribute function.

Then in the distribute function you can
Choose between 1:
call safetransferFrom(user, address(this), amount) to send the tokens to your contract first and then safeTransfer(recipient[i], amount[i]) for each recipient.

Or 2:
Call for each recipient safeTransferFrom(msg.sender, recipient[i], amount)
As there is no requirement to first get the token on your on smart contract.

I would go for the 2nd option there. Keep in mind that the user will have to call the approve in the token itself first authorising your smart contract address to spend the tokens.
You can not do this in your smart contract. Before you try transfer the tokens to the recipients make sure to call the allowance function on the token first to make sure the user approved your smart contract to spend them.