In Unix, a single file on the disk normally has one entry in a directory somewhere. In other words, it appears as /etc/myfile.txt or something like that. But the same file on disk can actually have MULTIPLE entries in directories, pointing to the same piece of data on the disk.
If it has multiple, then the file can be referred to by two or more names in the same or completely different directories, such as /var/something/file1.ext and /etc/something/file2.ext. They both point to the same file on disk, so the disk space used is equivalent to a single copy of that file. If you make changes to the file at one of its instances, you’re actually changing both (or all). If you delete one, then only that link to the file is deleted and the file still remains accessible under the other entry. Only if you delete the last link to a file will the file be deallocated from the disk.
Hard links can be confusing, because it breaks the way people might expect file systems to work. For that reason, hard links are rarely used, and soft links are often used instead. A soft link can achieve the same sort of goal but is implemented quite differently: you are actually creating a dummy (alias) entry in the file system which “points” to the other file. But you can easily see the dummy using tools like ls; it doesn’t look a normal file. It’s easier to see what’s going on. With a hard link, it’s done at such a low level that it completely looks like both are just regular files. You’d need some low level understanding of the filesystem used to detect hard links (usually it’s to do with comparing inodes - that’s an advanced topic). Soft links are also dynamic, based on a path. It’s possible to copy a soft link from one file system to another and the target of the link will change accordingly; hard links can only be to files within the same file system and they point to the file, not the path so you can’t point it somewhere else by moving it around.
Hard links can be useful as part of incremental backup schemes. Unchanged files can be stored as hard links of each other in different directories, so you can have multiple copies of a whole directory with a bunch of large files, but for unchanged files, the hard links mean that the disk space used is equivalent to only the one copy.
Only files can be hard linked, not directories. It is theoretically possible to hard link directories (and indeed, the operating system does - by creating entries called “…” and “.” automatically), but any user space program (even when running as root) is barred from doing so in order to prevent endless loops due to circular references. This is not a worry with soft links, because regular programs can detect circular references with soft links quite easily if they need to.
If you see a number other than 1 for a file in ls -l, then it has more than one link. Essentially, it is hard linked to appear in more than one place.
If you see a number other than 1 for a directory, then it just means that there are a “.” entry and perhaps some “…” entries which point back to this directory. You could use it as a rough way of seeing how many subdirectories the directory has, when you subtract 2. But it’s otherwise meaningless.