Start by building a solid platform with regular blocks to support your mechanism. Ensure there is enough space for the piston to extend.
Use wooden pressure plates for mobs, as stone pressure plates can only be triggered by players. To help tailor this guide, let me know: Are you building this for Java Edition or Bedrock Edition ? Is this trap meant for mobs or other players ? Share public link