Hi there,
that codepen is not a straight forward copy and paste. To start with it uses isotope.js and bootstrap.css – the latter being an entire CSS library which is a lot of CSS to reproduce this.
I would suggest looking for an alternative solution or you would need someone to develop.
If you’re able to do this then, jQuery should be hooked into the WP_foot as it needs to run after the content is loaded.
Scripts and Styles can be loaded using the WP wp_enqueue_script() and wp_enqueue_style() functions respectively. You can find out more on this in the WP developers guide:
https://developer.wordpress.org/reference/functions/wp_enqueue_style/