Targeting works as normal, except with disadvantage
Trying to attack a target does not require sight of the target. However, not being able to see the target means one's attack rolls are at a disadvantage, because the area is considered to be heavily obscured and thus the attacker is effectively blinded when attacking their target. However, if the target also can't see the attacker (both are effectively blinded to each other), the attacker would receive advantage and the attack is rolled with neither because they cancel out.
...or it might be an automatic miss
If the attacker has no information on the target's location - for example, sound of their footsteps, they might have to guess the target's location instead when making their attack (PHB 194-195). If they guess wrong, the attack can miss regardless of what the player rolls. What counts as the correct location is up to the GM unless playing on a grid. The GM is also not forced to reveal whether an attack at a guessed location misses because of a bad roll or a bad guess.
In situations where detecting the target's location might be challenging but possible, it is reasonable to allow a player to roll a Perception check to identify their position.
Some spells require sight
Many spells explicitly state the requirement to see the target. Simply knowing the target's location isn't enough, and no rolls can help one there unless they can somehow make the warlock visible in the darkness.