"how do you play a warlock in Pathfinder 2e" - fortunately, and unfortunately, the answer is perhaps fivefold I'd argue, depending on WHAT precisely about the warlock you find appealing: witch, thaumaturge, magus, psychic or oracle.
The PF2E witch is a full spellcaster using intelligence - but they rely on a patron who gives them their spells via a special familiar. Definitely Pact of the Chain warlock vibes. However, way more powerful spellcasting then a 5e warlock, more equivalent to a wizard.
The thaumaturge has strong occult vibes, focused on "esoterica" - magical scraps and relics that empower special abilities. No patron, technically not spellcasting, but a Charisma-based occult magic user that looks sick as hell. Does seem a bit Hexbladey though, given armor and weapon proficiencies and capacity for melee combat.
The magus similarly is a strong melee combatant, with limited spellcasting much more akin to how the warlock pact slots work in 5e (though Intelligence based). They can use spells to empower their weapon strikes, and they can only cast at their highest two spell levels available (though unlike the warlock, these levels go all the way to 9)
If the thing you like most about the warlock is being able to build a mass murderer around a cantrip, the psychic might be right for you. One of their cool base class features is additional psychic-only cantrips, which you can then "amp" for more power and utility.
The oracle, like the thaumaturge, shares more flavor than mechanics with the warlock, and is probably the weakest case for equivalency in this post. They're charisma casters with divine spells, but unlike clerics their power isn't from a god, but rather a "mystery". One of their key features is a curse, which as it's strengthened provides both power and drawbacks. The curse mechanics feel very eldritch.
ANYWAY at first glance I was like "wtf no warlock, that seems like a missed opportunity" but no, Paizo was like "how do you like your warlock?" and served you up a buffet.
Visit Archives of Nethys if you're interested!