Unfortunately, you can't maintain both temperature and humidity at the same time because their changes are closely related.
As the air conditioner or heat pump cools/heats, it doesn't just impact the temperature, but also the humidity level.
Relative Humidity (RH) is the amount of water vapor the air is holding right now as a percentage of what it would be holding if it were saturated.
Hot air has a higher capacity for holding moisture in the air, so if there are no additional moisture added, and the temperature rises, the relative humidity decreases.
On the other hand, cold air increases relative humidity.
You must be thinking, we should use hot air to reduce humidity then?
Not exactly. When the humidity in your room is high, cooling your room would increase the relative humidity (which high relative humidity is uncomfortable), but as part of how air conditioners cool, where the warm indoor air passes over the cool evaporator coils, it condenses the water in the air and removes it through the drain pipe and into the condensation pan beneath the outdoor unit of your system. Therefore reducing the humidity in the room. So yes, the relative humidity increases if we cool, but the end result is still what we'd want.
In other cases, if it was cold outside, it's unthinkable to have to switch on cooling. What do we do then?
By heating the room, we'd be decreasing the relative humidity and making condensation less likely, so the in-room humidity is still maintained at a level where we could feel comfortable.