This is the easy part — and the fun part. Read riddles. Lots of riddles.
The more you familiarise yourself with riddles and their format, the easier it will be to write your own. You'll find tons of fun little gems out there. "What goes up but never comes down? Your age."
"What has a face and hands but no arms and legs? A clock."
(Just be careful how far down the rabbit hole you go.... if you hear yourself say, "riddle me this," it's time for a break.)
During your search, why not take some time to peruse great DIY escape room examples,
like this one? After all, that's what your riddles are for!
Then, search for logical riddles. These provide great ideas you can apply to your escape room at home. While some of the logical riddles contain a bit of humor, their focus is forcing you to think. After a while, you will understand how to craft a strong riddle that forces people to think through the problem. Take this riddle, for example:
Todd is looking at Karen. Karen is looking at Timmy. Todd is married, Timmy is not, and we don't know if Karen is married. Is a married person looking at an unmarried person?
Answer: Yes. If Karen is married, then she is married and looking at Timmy, who is unmarried. If Karen is unmarried, then Todd, who is married, is looking at her. Either way, the statement is correct.
This riddle, while lacking any humor at all, forces you to think through the problem. While this can be solved with some quick thinking, it helps you understand your needed structure. Read more of these kinds of riddles and less of the "why did the worm cross the road? To get away from the chicken" variety.