To add a button at the end line of the main menu, firstly you have to enable the button option for Header custom item under the Dashboard > Appearance > Customize > Header area > Menu layout.
Here is the screenshot for your visual guide.
You’ll need an extra CSS code, that you can add into Additional CSS, to shift down the button.
I hope this reply helps.
thank you for the reply! it worked,
I’m trying to add a search button now, is there any easy way to do it?
Try this additional script solution: https://gist.github.com/kharissulistiyo/877002bcc3c534fef921805b31b5a376