It takes about 30 seconds to rip apart and devour a fortune cookie (after reading the prescient message inside, of course), but making them by hand is a time-consuming process. While most of the fortune cookies served at Chinese restaurants in the U.S. are mass-produced, homemade cookies with personalized messages stuffed inside make great gifts and impressive party favors. Perhaps most importantly, they taste better, too.

Tammy, a Canadian cook behind the YouTube channel Yoyomax12 - The Diet-Free Zone, has broken down the process into a few simple steps. First, the batter is prepared by combining egg whites, vanilla extract, almond extract, vegetable oil, flour, corn starch, salt, sugar, and water in a bowl. Other recipes call for lemon or orange zest and melted butter to enhance the flavor.

Once the batter is well-mixed, two dabs are scooped onto a greased cookie sheet, and a spoon is used to spread it out. The batter is then baked for 11 to 12 minutes at 350 degrees Fahrenheit until the edges are lightly browned.

The next step is when things start to get tricky. The cookies are soft and malleable when they first come out of the oven, but they quickly harden, so time is of the essence. As Tammy demonstrates, one of the cookies is picked up—they’re hot, so gloves are recommended!—and a paper fortune is placed in the middle. It's then folded in half, and the folded edge is lightly pressed against the rim of a mug to fold it one more time, giving the cookie its distinctive shape. After doing the same with the other cookie, the entire process is repeated by baking more batter.

Tammy suggests that beginners start with just two cookies at a time until they get the hang of it. “You have to fold the cookies when they’re still warm,” Tammy says. “If you fold them when they’re cool, they crack and they break into pieces because they get very brittle.”

Of course, fortune cookie companies use an assembly line to expedite the process. Machines take care of the mixing, baking, and folding, and videos of that process are available online (including one featuring Jimmy Kimmel). One manufacturer reportedly churns out 4 million fortune cookies per day.

Interestingly, although the Pacman-shaped cookies are a staple at Chinese restaurants, their heritage is largely American. Some have traced the confection's origins back to early 20th-century California, while other researchers have said its shape is uncannily similar to fortune cookies served in Japan decades before they popped up in the U.S.

Ready to try it out for yourself? It may take a bit of practice to get it right, but take some advice from a fortune cookie: “All things are difficult before they are easy.”