If you want a more instructional guide, here is an article on Medium: https://medium.com/a-taste-of-madness/level-zero-how-to-start-designing-your-first-tabletop-role-playing-game-c70820702041
Personally, I think the best way to learn how to write a TTRPG is to read them. There are many short TTRPGs on itch. Grant Howitt has many great one-page RPGs. You can also read the entries of 200 Word RPG Challenge for inspiration.