You press confirm on the pit request with the penalty selected, and you will go straight thru the pit lane. And the penalty will be served.
What heppsan said + my understanding is that you need to do that only when you see "Must serve drive through penalty this lap". Otherwise, there is no option to serve it. I just stopped twice (first time too early) and placed 2nd instead of 1st.
You should be able to serve drive-through penalties even when not prompted that it is the final lap before being disqualified. As Heppsan points out, you need to bring up the Pit stop menu, select the drive through to be performed and then confirm these pit actions.