A layup is a shot right underneath or close to the rim; it is the most basic and high percentage shot in basketball.
The closer the shot, the easier the shot. Since you’re so close, there’s no need to shoot it with a typical shooting stroke.
For the purpose of speed and ease, use one hand/arm to put it in.
Most often, layups are driving to the basket, meaning you’ll be on the move. Footwork is important here.
Using your right hand, jump off your left foot, meaning on the drive, step right then jump off the left foot.
Using your left hand, jump off your right foot, the exact opposite of the right handed shot.
If you're right-handed and you haven't developed the use of your left hand well, you can go up on the left side with your right hand jumping off the left foot as well.
If you’re already standing by/underneath the basket, either receiving a pass or looking for a putback, it’s best to jump off two feet.
*Another situation where it helps to jump off two feet is if you’re anticipating CONTACT. Jumping off two feet helps your body absorb contact in the air.
It’s good practice to use your off arm to fend off defenders trying to disrupt or block the shot.
You can lay it off the backboard or directly into the basket. Using the backboard, makes the shot much easier.
If you're coming straight down the middle and laying it in directly at the front of the basket, try using a "finger roll," where your hand is underneath the ball and it rolls off your fingers into the basket smoothly. This move takes more finesse and practice.
With the proper technique and practice, even a defended layup is easier to make than a defended jump shot.
Here's a video from NBA.com with Lenny Wilkins going over the important points of a fundamentally sound layup: