There are essentially two ways to manage dependencies of a Lambda function.
Using lambda layers: A Lambda layer is an archive containing additional code, such as libraries, dependencies, or even custom runtimes. When you include a layer in a function, the contents are extracted to the /opt directory in the execution environment. You can include up to five layers per function, which count towards the standard Lambda deployment size limits. Have a look at this article for more details.
Using container images: You can package your code and dependencies as a container image using tools such as the Docker command line interface (CLI). You can then upload the image to your container registry hosted on Amazon Elastic Container Registry (Amazon ECR). See the official docs here.
Because Lambda can scale to zero, it suffers from a so-called cold star issues. This means that unless there is a warm, running container instance available, Lambda has to "cold start" a new container causing some delay, especially for large footprint applications stacks such as JVM based.
Best, Stefan