The first step is made in your Google Tag Manager account
Log in to your Google Tag Manager account at https://tagmanager.google.com/#/home
Click the Cog shape to the top right of your relevant Tag Manager instance
Click Install Google Tag Manager
Copy the code in the top box using the copy icon on the right
The second step is made in your WordPress Admin
The first step is to make sure that you have installed and activated the Wordpress Insert headers and footers plugin from https://wordpress.org/plugins/insert-headers-and-footers/
In WordPress go to Settings -> Insert Headers and Footers from your admin panel.
Add the code copied from Google Tag Manager into the Scripts in Header field.