Mechanically, there are a few ways.
The Fighter has a "Know your Enemy" class feature (PHB 73):
Starting at 7th level, if you spend at least 1 minute observing or interacting with another creature outside combat, you can learn certain information about its capabilities compared to your own. The DM tells you if the creature is your equal, superior, or inferior in regard to two of the following characteristics of your choice:
These choices include Strength, Dexterity, AC, HP, and class levels.
Moreover, you can call for various intelligence checks to determine how much a character knows about a creature. For example, (PHB 177-178, emphasis added):
Your Intelligence (Arcana) check measures your ability to recall lore about spells, magic items, eldritch symbols, magical traditions, the planes of existence, and the inhabitants of those planes.
Your Intelligence (Nature) check measures your ability to recall lore about terrain, plants and animals, the weather, and natural cycles.
As a DM, you have other tools.
By using these abilities and checks, characters might be able to glean some insight into how powerful an enemy might be.
However, other times PCs have no idea how strong a particular creature might be. For example, a plainclothes person with a satchel might be a commoner, or a powerful archmage--both could look identical in appearance, and you'd only know the difference once you fought them.
If you want to telegraph something non-mechanically, you can do so with context: a lair that's full of dead birds might not be threatening, but a lair full of the bones and armor of adventurers might be. Likewise, if there is advance notice, the characters can choose to do research on the creature in question.
Ultimately, as a DM, I use a mix of these strategies: sometimes, I let the characters make a check to know that a particular fight will be easy or hard, sometimes, I give the players no clue as to how strong a creature is, and other times, it's patently obvious (e.g. a giant flaming balor).