Trade them by getting a link cable or wireless adapter (use the adapter by having a device that you can put underneeth the game cube) and purify them to trade them and beat the game.
that is one of the source say to put it in the GBA Pokemon games
Put your Pokémon LeafGreen cartridge into the GBA slot of the Nintendo DS. Put your Pokémon Platinum cartridge into the DS game slot. Start your Pokémon Platinum game and choose the "Migrate from Pokémon LeafGreen" option in the menu. When asked to migrate, say Yes. When asked to confirm, say Yes. Choose exactly six pokémon (no more and no less) to transfer. After choosing, say Yes, and when informed that the pokémon cannot be returned to the GBA cartridge, say Yes.
Then start your game of Pokémon Platinum. You need to go to Pal Park in the game. The Pal Park is in Route 221. To get there, go south from Sandgem Town and use Surf to travel to Route 219. Go south from there to Route 220, then use the northeast path to go to route 221. Keep going east until you reach a building. This is Pal Park. Go inside.
Before using Pal Park, you might want to bring a Pokémon with you that knows Surf, because certain areas of Pal Park are only accessible with Surf. If this is your first visit, Professor Oak will talk to you. Afterward, go up to the counter and talk to the guy wearing a construction helmet. Say Yes when asked to participate in the Catching Shows. He will ask if you want to read the instruction manual. When you are done, choose UNDERSTOOD! Then say Yes to participate in a Catching Show now. He'll give you six Park Balls. Then you will enter the Pal Park. Run around in the tall grass to encounter the pokémon that you migrated from Pokémon LeafGreen. The Park Balls always capture successfully, just like Master Balls (but you can only use Park Balls inside Pal Park), so just throw a Ball and you will catch the pokémon. Repeat this process to catch all of the pokémon that you migrated from Pokémon LeafGreen. After you have caught them all, you will be asked if you want to put all of the caught pokémon in PC Boxes.
that is one of the example to send a Pokemon gen 3-4
To transfer pokémon from Pokémon HeartGold to Pokémon Black, go to Route 15 in Pokémon Black and go into the Poké Transfer Lab. Go inside. If this is your first visit, a scientist will talk to you and take you to the top of the room. If you have visited before, go talk to the scientist at the top.
When asked to use another DS, choose Yes. When you are informed that the pokémon can't be sent back, choose Yes. When prompted to start DS Wireless Communications, choose Yes. When asked to save the game, choose Yes.
Turn on your other Nintendo DS or 3DS that has the Pokémon HeartGold cartridge in it, then choose DS Download Play from the menu (if using a 3DS, Download Play is in the home screen. Look for the orange icon with a DS on it. When prompted, choose to download Nintendo DS software). Select the game that has the ID number that is displayed in your Pokémon Black game, then say Yes to download. After it downloads, choose exactly six pokémon that you want to transfer, and say Yes when asked if you want to transfer those pokémon. Say Yes if the game tells you that held items will be put into the bag.
After you have chosen the pokémon, you will play a minigame in Pokémon Black where you throw pokéballs at pokémon that move around the screen. To throw the pokéballs, drag the stylus on the touchscreen to pull the Pokéball downward, and watch the top screen to see where the pokéball will land. Take the stylus off of the screen to throw the pokéball. If a pokémon is hiding in a bush, throw a pokéball at the bush to make the pokémon jump out. Throw a pokéball at a jumping pokémon to catch it. Near the end of the time limit, a pink cloud of Sleep Powder will float across the screen. Hit the pink cloud with a pokéball to make the pokémon fall asleep. Then throw pokéballs at the sleeping pokémon. If a pokémon is not on the screen when you hit the pink cloud, you won't be able to catch that pokémon until it wakes up and comes back onscreen.
If there are any pokémon that you do not want to send from Pokémon HeartGold to Pokémon Black, just don't catch those pokémon. Uncaught pokémon will go back to Pokémon HeartGold.
After the time runs out, you will be asked if you want to transfer the caught pokémon. If you say No, the pokémon will go back to Pokémon HeartGold. Otherwise, say Yes to transfer them. The game will be saved. You will be asked if you want to use the Poké Transfer again. Choose No if you are done, or choose Yes if you want to transfer more pokémon. If you are done, the game will ask you to turn off the power.
you can use any gen 4 games
From there, leave any Pokemon that you want to transfer in your Gen 5 copy in your first box. Then on your 3ds download Pokemon Bank, and Poke Transporter. Pokemon Bank costs $5. Go to Poke Transporter and select your Gen 5 game that is in your 3ds. After a minute, your Pokemon will be in the Transport Box of Pokemon Bank.
from gen 5 games to Pokemon bank
Now you can select the Transfer to HOME option in Pokemon Bank, (home membership required,) select your Pokemon, and you will be finished. Your Pokemon from LeafGreen will now be in your Pokemon Home, where they can be easily transferred to Swsh.
so you need to transfer it to HOME, then transfer it to swsh
Hope I helped!