Hide media on external sd card, lollipop and above
by renaming a file from filename.txt to .filename.txt (add a dot "." before the name) you will hide the file. I.e. it will not show up on any file explorer, (unless it is set to show hidden files.)

If you want to hide, say movie files from appearing in your media player, or music files from appearing in your music player, or even photos from appearingin your gallery, (or any other type of file from showing in an app except a file explorer), you can change the file extention to anything else or remove it completely.
I recommend just changing the dot "." to a blank space, that way you can still identify the file yourself and you wont forget the file extension in case you ever need it.

like so: from "filename.avi" to "filename avi".