The how depends 100% on what puzzle do you want.
- You can have a puzzle where based on exploring a map you see signs that have clues and then you need to answer a question.
- You can have a puzzle just to get out of a room where you have to stack items in just the right sequence to reach a vent for escape.
- You can have a puzzle requiring you to rewire an alarm system. Do it wrong and it blows up.
All of those puzzles have different ways of doing them. Some require scripting, some do not. Some might require custom entities, others don't. First decide what you want the puzzle to be. Then search the boards and see if anyone has done anything similar. Then try making it. When you get stuck, ask for help, but be sure to share what you've done so far.
"Everyone has a plan 'till they get punched in the mouth" -- Mike Tyson