Anyone know how to create a fixed/sticky menu?

I’d like to create a menu like

I’m having a bit of trouble. I’m wondering if someone can point me in the right direction. Simply changing my header or nav class to position:fixed doesn’t work because I need to slightly change the appearance of the menu (like on Yoast). Any and all suggestions will be appreciated! Thanks!