Sending token from smartcontract to an address

Hi, i'm writing a smart contract, but i already have an issue,
the scenario is: my smart contract should send the specified amount of a token(which is already deposited into the current smart contract) when it's 'transfer' function is called.
is there any sample in solidity to do it?
I already wrote a smart contract, but it only sends zero transaction, without the token.

Hi, welcome! :wave:

I think just token.trasfer(to, amount) is ok, and of course, you can use some library to make it much safer, such as: SafeERC20.sol

And you can share your code at here if possible.