If you want to add additional HTML code in your image. The default text widget allows certain basic HTML, however it cannot work with innovative HTML or formatting. In this case, you should manually add an image to the sidebar of your blog.
First of all, you should upload the image to the website of your website.
Just go to media->Add new, and just upload image file
Once you upload an image, you should click or edit link aside your image
After that wordpress will navigate you to edit the media page. Here you will be able to see image file URL on right side of the screen.
Now, you should copy the URL, and paste it into a text editor like Notepad.
Next, you should go to Appearance->Widgets screen and drag-drop Custom HTML widget in your sidebar where you want to display images. Add the following code in image text box area: <img src="Paste The File URL Here" alt="Strawberries" />
The img tag is used for displaying images, and it needs two attributes- First SRC to define the location of the image file, and second is alt that offers alternate text for the image. The final appearance of this img will be like this: <img src=http://www.example.com/wp-content/uploads/2020/strawberries.jpg alt =Strawberries/>
Apart from this, you can also add image sidebar of wordpress through plugin, or widget.