Open source licences are one of those cans of worms I mostly try to avoid. Except it really annoys me when I want to borrow some code and I can't work out what the licence is.
If you're writing sample code or something small, you should include a #licence. However which to use? One of the *BSD or MIT licences is usually a good choice (but be careful which version!), they place minimal requirements on you. However the requirement to include a copyright notice is just annoying for everyone involved (when the code is small). Android Toybox (https://en.wikipedia.org/wiki/Toybox) solved this with the Zero-clause BSD licence (aka #0BSD); it is a modification of the ISC license, not a BSD one, but the name doesn't matter really.
While 0BSD may not be perfect, I believe it (or MIT-0, which is nearly identical) achieves the best balance of all the "do what you want" licences. I'm mainly talking about "small" pieces of code here; for larger projects it's understandable the licence choice is more nuanced and you may want Apache, #GPL, etc. This is not legal advice. Talk to a lawyer if in doubt.