Will anyone know if you fail out of a master's program? Suppose that someone enrolls in a master's program but then fails out. Will future employers be able to find out about this? Or can this person just pretend it never happened, and there will be no blemish on their record. 

If this person applies to other master's degree programs (in a different, better-fitting field) in the future, would those programs be able to find out?

A little context: this person has the option to withdraw by a certain deadline, and needs to decide whether remaining in the program is worth the risk of potentially failing out.
It may be that they would learn of it, or possibly not, but the consequences of them learning that you omitted something that they considered important could be dire. It would be treated as a mark of dishonesty and neither employers nor universities generally value dishonesty. 

The record exist and might come to view at some point, though they would, in most cases, not be sought. But you need an explanation for the time you have spent. If it is a black hole it looks pretty bad on your record, both for an employer and for a future degree. 

You are probably safer to just be honest. There may be reasons for failing out that others would consider valid. Academia isn't for everyone and many people have various struggles that make success difficult. 

If you have access to an academic counsellor, you should make an appointment and go. You may get good advice there about withdrawal and your future plans.