The other answers do allude to rules of thumb. Riders should think of them as shortcuts to get a starting position. Because individual physiology varies, many people may find that the rules of thumb don't exactly work for them.
Bike store sales staff will probably be trained to offer a basic fit to help you select the right bike, and they'll probably use these rules of thumb to set the saddle position. Anything more in depth requires specialized training and experience. There is a small industry of professional bike fitters who do this task. Bike fits are a bit of money up front, but if you find a good fitter, they can pay dividends down the road. Serious cyclists should consider seeing a fitter in person.
Meanwhile, there are some visual and physiological indicators you can use to check if your saddle is wrongly positioned - the problem is that for some of them, you need someone else to observe you, and you need to be pedaling under load. The physiological indicators require you to know what you are feeling when under effort, which can be tricky for beginners.
If your saddle is too high, your hips will probably swap side to side. Here is a video by Steve Hogg showing what this looks like from the rear. and you'll point your toes down at the bottom of the stroke because the pedals are too far away. Here is a video by ERO sports showing what it looks like from the side. You can also see an example of what a reasonable amount of leg extension looks like from the side. Having the saddle too high raises the risk of an overuse injury over time, as I can attest.
If you're just sitting on a stand in the bike shop, or you just have the salesperson hold the bike and you backpedal, you probably won't see this pelvic instability. You need to be under load. You might enlist a ride buddy to check while riding. You might borrow someone's smart trainer and then ask them to watch you as you pedal, or you film yourself. Speaking of the latter, there is an AI-powered bike fit service, My Velo Fit, that works off rider-submitted videos. It judges angles by camera. It is inexpensive compared to in-person fits, but I do not know how reliable it is in real life.
From my understanding, a lot of serious cyclists may have their seats too high. I believe there's a general understanding that higher = more power, which may be the root cause. I think this maxim may not be true once your saddle height is approximately right, although the average civilian most likely has their seat too low. It seems you don't lose much power if your saddle is too high (unless it's much too high). I have heard several bike fitters remark that a lot of their clients have their seats too high. Keep in mind that people tend to go to bike fitters when they have some sort of problem, like an overuse injury, so this may not mean the average serious cyclist has their seat too high.
Here is one YouTube video by Cam Nichols and Neil Stanbury discussing saddle height. Stanbury is a bike fitter. It's worth watching the whole thing. I do not believe that Stanbury clearly answered how you know your saddle is too low. He did say that you can experiment: set your saddle low, get on a trainer and ride at about a 20 minute effort pace (perceived exertion about 7 on a 10 point scale, about a threshold effort). Gradually raise the saddle 5mm at a time. If you feel the symptoms of the saddle being too high, immediately lower the saddle by 5mm or so.
For fore-aft position, the traditional heuristic is that if you drop a plumb bob from the front of the kneecap, it should intersect the ball of your foot. As with the heel over pedal technique, this is a heuristic that, if it's approximately right, is only right by coincidence. There isn't a physiological reason behind this.
One indicator that your saddle is too far forward is that you put a lot of weight on your hands while riding. Another indicator is as follows. When you're pedaling at a moderate to high effort (about a threshold effort, perceived exertion about 7 on a scale of 10), take your hands off the bars but keep your torso bent forward. People with average core strength should be able to easily hold their torsos up if their saddle's in the right place. If it's too far forward, you probably won't be able to hold your torso up. Neil Stanbury demonstrates this in a video. This test originates with Steve Hogg, an Australian bike fitting pioneer. Stanbury is a trainee of Hogg's. The entire video is worth watching. In addition, if you never feel your hamstrings engaged during efforts or you feel like your quads are over-working, that could also mean that you're too far forward.
Indicators for the saddle being too far back may be less reliable. You may feel like your hands are too light on the bars. If you have to round your shoulders forward, this could be another indicator, but that could also mean your handlebars are too far forward. Stanbury says that you should ride with your saddle as far forward as it can be before you run into the problems above; I am not sure if that's a universal bike fitter opinion. In any case, Stanbury also points out that you can experiment, on the road or on the trainer. You could set your saddle all the way back, then ride for a bit. As above, you want to put out a decent effort, otherwise you won't detect problems. You can then move your saddle forward in 5mm increments until you feel right. If you fail the hands off the bar test described above, then move it backwards.
Most riders should set their saddle level. Pro road cyclists often angle their saddles' noses down. They may have their reasons. However, doing this will put more weight on your hands. Pro cyclists are light. Furthermore, as you push down on the pedals, you push your body up, and pros are pushing down with much more force than the rest of us.
Some saddles are exceptions to this. They're in the minority, but you might want to check. All Selle SMP saddles should be angled down a bit, although this is a niche saddle. I believe that Specialized Power saddles usually are very slightly nose down. Many Brooks saddles are mounted nose up, although I think I usually see that on bikes with handlebars a bit above the saddle.
Some cautions and miscellany
To some extent, the indicators above do depend on everything else on the bike being in about the right place. When you change one fit parameter, others often change. For example, if you swap to shorter cranks, you should actually move your saddle up to maintain the same leg extension at the bottom of the stroke. If you move your saddle down by a lot, that also moves you forward, so you may want to move the saddle back.
Also, never use the saddle fore-aft position to compensate for the handlebars being too far away. You need to change the stem length for that, or possibly use a handlebar with less reach.
As mentioned in the intro, cyclists should really consider a bike fit. In fact, our bodies and desires change with time, so long-time cyclists often benefit from repeat bike fits. You should be able to find a good fitter in most major cities. The problem is sorting the good from the others. You can ask friends, but be aware that consumers may not know what a good fit experience is. And because they've paid for a fit and they don't want to speak ill of people, your average opinion is probably biased positively.
I am pretty sure that good bike fitters should assess your physical function, e.g. range of motion and core strength. They ought to be open to all types of riders, especially not discriminating against more casual cyclists. Some bike fitters may not wish to work with flat pedal users - this may be bias, but you may not always put your foot in the same position on flat pedals, which may present them a problem. However, you should be able to find someone who will work with you.
I do not know of many reliable indicators of a bad fitter.
Other sources of information
Stanbury, above, is influenced by Steve Hogg. Hogg output on the Internet is mainly writing, and some of the articles are dense. I think that Hogg's ideas about cleat position - he advocates for an extremely far back position - are out of the mainstream. I believe his other advice is sound from my personal experience. So, some might want an alternative perspective just to be sure they're getting good advice. Two alternatives follow.
John Weirath is a bike fitter who I believe is not a Hogg disciple, and I think his advice generally dovetails with Hogg's.
Francis Cade's channel covers cycling in general, but he has a number of interviews with James Thomas, another non-Hogg bike fitter. In this interview, Thomas claims that 99% of cycling ailments are attributable to the saddle being too high. Both channels cover other bike fit topics. Thomas has a number of rants about products he thinks are a poor fit for the average consumer.