Guest posts are good to get links which help your website's SEO. But, you should never compromise on the quality of your content.
Always write something of value and with a good user experience in mind.
Create a piece which will get people to link to you because of the quality of the content, not because it has a link to your website or guest post on your blog.
If you are writing a guest post for someone’s blog, make sure you bring something new to the table. People will trust you and your blog more if you bring something unique, not the same information everyone else is providing.