You will generally want to look for something that is a solvent, or is solvent-based.
A good homebrew 'degreaser' would be using washing soda (sodium carbonate) diluted in water. You can make washing soda from baking soda by heating it (baking soda) up on a stove. There are plenty of videos and guides on how to safely to this.
But in terms of effectivity, you are better off buying citrus cleaner concentrate and diluting it in water or buying degreaser bottles. Heavy-duty degreaser on store shelves often contain alkaline washing agents and a few other chemicals that make them much, much more effective than anything you could easily make at home. If you are having unsatisfactory results with degreaser that you have bought before, you may have unrealistic expectations of what degreaser can do. It does not completely dissolve heavy dirt and grime build-up, you generally need to scrub down and/or use a pressure washer afterwards.
Regarding safety, solvents that are strong enough to aid in cleaning engines will always be mildly or considerably toxic to humans. Although many people will not wear mouth/nose protection when using degreasers or solvents, it is generally a good idea as prolonged exposure and inhalation of them can be detrimental to you.
In short, look up how to make washing soda, dilute it in water and use that. Have low expectations of how well it will clean compared to store-bought degreasers and solvents, and possibly go through a more involved process of cleaning out your engine. Wear mouth/nose protection if you can.