Abdullah's answer is excellent, but I wanted to add:
If you're airdropping on devnet automatically (eg in a unit test or another script that is ran frequently)
I'd suggest airdropIfRequired from the @solana-developers/helpers
repository. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually contact the faucet (and hence not affect your rate limit) if you already have enough SOL:
const newBalance = await airdropIfRequired(
connection,
keypair.publicKey,
0.5 * LAMPORTS_PER_SOL,
1 * LAMPORTS_PER_SOL,
);
If you don't actually need devnet
Remember you only need Airdrops on devnet! If you don't want to test in Devnet just fire up a local validator where there are no airdrop limits!
solana-test-validator