How to make outlines around 2d objects?

I am trying to figure out a somewhat simple yet niche outlining method. I need to be able to produce outlines around both SpriteRenderers AND UI Image components.

Also, and this is the most tricky. I would also like so that, if the camera zooms in or out, the outlines stay the same physical size. This last one is very tricky/strange wishful thinking though. If you have an answer to just the first part, I would like to hear that as well!

There is a video by Brackeys that shows how to make an outline shader for 2D, that might help.