Worked out off and on all my adult life. Most of the time walked a lot at work. Then switched to web job. How to get back in shape safely?

Just start. The first step in completing any hard task is to just start. Unless you have any pre-existing medical conditions or health concerns, start slowly & add volume and intensity in small increments. Mix in both cardio and resistance exercises. Shoot for at least 20 minutes/day and 3/week and build from there. Try different exercises to find what you enjoy. If there are health concerns, talk to your doc.