You do it by providing the best choice for users over decades. Or if you're an actual lock-in firm like MS, you do it by embedding yourself in every government department and company and school, so people go from cradle to grave using your products.
MS's main lock in is the MS Office file formats (the entire "open" standards process around this was co-opted and destroyed), and then the predatory bundling/extension (browsers, email, Teams) to knock out competitors.
Windows isn't the crown jewel - the real value is doc/xls/ppt that wrap people's data and bundling of everything into a MS license that marginalizes 3rd party entrants like Slack.
MS's main lock in is the MS Office file formats (the entire "open" standards process around this was co-opted and destroyed), and then the predatory bundling/extension (browsers, email, Teams) to knock out competitors.
Windows isn't the crown jewel - the real value is doc/xls/ppt that wrap people's data and bundling of everything into a MS license that marginalizes 3rd party entrants like Slack.