I assume you have the picture of the badge as well? You first have to upload the picture to your media library and get the URL for the uploaded file. To do that, go to the media library, click on the title/file name of the picture. The URL should be on the right. Copy this and paste it into your HTML code.
Next go to Appearance > Widgets in your dashboard. Create a new text widget in your sidebar and paste the code into it. Save, and if your code is correct the image should appear on your blog.
If you’re not including the code that other bloggers can capture your badge it might be simpler to merely use an image widget. You’ll still need the file’s URL, but you won’t need to mess around with HTML.
I have the same issue but I’m afraid I don’t understand the answer provided. I can only copy the code from the website, not the picture. How can you add a badge on the sidebar or on the text itself in this case?