Let me assume I would like to share a particular image that contains certain simplifications. I don't want to directly paste it to make the question short, simple, and straightforward. So, the best way to do this is to generate a link that would open a new page and show the image. But, I don't want to create a new link from other third-party websites like imgBB where you upload an image and then get the link.
Is there some kind of facility provided by Stack Exchange itself to do this?? (I am quite to new Stack Exchange. I am learning and would like to contribute and ask more and more questions here.)
Similarly, I want to know about something similar for sharing code as well. Sharing the screenshot of the code is quite inefficient not allowing others to copy and edit it easily. The best way for this is the same as above but, this time link would redirect to a page where the text is visible, copyable, but not editable.
How can we do this for a code sharing?