The material that cycling shorts are made of is usually stretchy enough to allow access to the male anatomy just by pulling the front of them down. You may need to adopt a bit of a forward lean, but it's easier than getting completely undressed.
For those without a penis, or those in need of a slightly more involved nature break (yes, a poop) you will need to take your jersey off and then pull the shorts down wholesale. Some cycling shorts, the majority of them women's specific for good reason, feature a 'drop tail' design that allows you to pull the rear of the shorts down without having to get totally undressed.