A CMD window should open and here paste your serial key, finally press ENTER. Wait until your key is verified.
A confirmation window should be visible after this step asking to open Apex legends, like shown.
The loader will then request you to open the game and then this window will self close.