It's fairly simple: Find people you would like to connect to, find their email address, send a request.
It helps if you have a "weak ties" connection to them, even if you don't really know them: you may be connected via someone else (in which case, asking for an introduction will almost certainly work), you may both be alumni of an org or institution, you may both have attended the same event (this works in a sort of 'missed connections' fashion), and so on.
One somewhat counterintuitive tip: you don't need to connect to a lot of hyper-connected folks, probably just one or two that are actually in your industry. Intros through indiscriminate folks like that tend to be disregarded unless there is a highly targeted ask simply because most of the folks they are connected to don't actually have an existing relationship or particular affinity with them. Similarly, so called "LinkedIn Open Networkers" that accept all incoming connection requests are also something of a red flag, unless you are actually in an industry like recruiting, marketing, or PR, where a 'reach' numbers game is a viable strategy.
Once your network starts growing, you'll start to get more incoming requests from folks trying to do the same thing you are. Don't accept the ones that don't make any sense (eg. If you are a medical software dev in the Midwest, feel free to decline that random connection request from an accountant in Azerbaijan), or you'll start to get a lot more of those (because folks who connect to lots of random folks tend to be mostly connected to others who do the exact same thing).
Absolutely reject and report requests that are outright spam. If you aren't sure, you can reply to ask what led them to try and connect with you before you make the decision to accept ignore or reject the request (saying "Hi, thanks for reaching out. I'm sorry, but I have a terrible memory, and I don't recognize your name or profile image. Did we meet at an event last year?" will work without being insulting).
It all boils down to this: if you want to have a large but high quality/relevance network, you need to be prolific but not indiscriminate in making connection requests.