This is called tucking. You can construct or purchase a gaff or use tape.
If you’re using tape, then put your testicles into your body (push them into it, into your inguinal canals) and hold your penis down and through your legs, so that it points away from you to your rear. Then tape it down. You should cleanly shave your entire genital area before using tape. TODO: find a good brand/make/type of tape.
For comfort (and safety, and convenience) we recommend using a gaff.
There are plenty of guides out there on the internet for tucking. Use Google and/or YouTube (or maybe other sites) to find what sort of technique you want to use.
You can also use 2 or 3 pairs of tight knickers/panties.
To remove your penis, see read this page.
Edit this page – License – Contribute – Conduct Guidelines
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License Version 1.3 or any later version published by the Free Software Foundation with no Invariant Sections, no Front Cover Texts, and no Back Cover Texts. A copy of this license is found in /fdl-1.3.html
For information on who owns what copyright on each page, in what years, refer to the Git repository that the site is hosted in, and check commit logs.