How to import library inside the function node?

That depends on how you have deployed n8n.

Are you running n8n right from the repository? In that case npm install @aws-sdk/client-redshift should be all you need.

If you’re using a custom docker image, this would be the way to go: Problem for Adding packages to a docker install - #2 by MutedJam