The penis is used for two functions: urination (peeing), and reproduction. Both the semen (cum, ejaculate fluid) and the urine come out of the same hole, called the urethra. However, the two cannot come out together at the same time. The sperm is produced in the testicles, and then travels through tubes into the body and into the penis. For the semen to travel to the penis, the penis must be erect. It fills with blood like a balloon, and is no longer in its soft state. This helps the penis enter the vagina during sex.
There's a lot more to how a penis works, and Im not exactly sure what you mean. You can always look up more information on the internet, like wikipedia, or even a biology text book.
Attention: NOTHING on this site may be reproduced in any fashion whatsoever without explicit consent (in writing) of the owner of said material, unless otherwise stated on the page where the content originated. Search engines are free to index and cache our content. Users who post their account names or personal information in their questions have no expectation of privacy beyond that point for anything they disclose. Questions are otherwise considered anonymous to the general public.