One of the worst things is to get your cherished bike stolen. That’s why you need to get a proper lock. First, you need to avoid using cable locks. They’re just completely useless. Buy a proper U-Lock, or two (one for each wheel). You can rely on the Sold Secure Gold Standard to make your choice.
Bare in mind that any lock can be undone using the proper tools with a certain amount of time. Make it hard enough and long enough so the thief will go for another option and your bike will be safe.
If you’re not fond of carrying a backpack while cycling, you might consider bikepacking. There’s plenty of options available. You should first consider what you need to carry and choose the configuration accordingly. If you just need to bring fresh clothes with you, a wide saddle bag might be enough, or paired with a handlebar or frame bag for a little more volume.
Back wheel bags are worth considering if you bring your laptop with you. And of course, all of these items need to be waterproof.
For your own and others’ safety, you should buy bicycle lights. Using lights during daytime reduces the cyclists’ accident rate by 19%, according to a Danish study.
You usually look for a white light at the front and a red light at the back. Most lights are rechargeable nowadays, so you won’t have to bother buying alkalines every now and then. You can choose your light by the amount of light they produce (in Lumens) and their beam pattern (the beam width).
Again, you can get good advice asking you local bike shop.
Mudguards are essential for rainy weather. Ass savers can be a good option for road bikes, really lightweight and cheap.
Most city and touring bikes come with standard fixed mudguards, more efficient if you want to avoid getting any water on your trousers. You can also mount them on most bikes.
There are tons of electronic devices you can add to your bike. Whilst the cadence and power meters are performance oriented, a GPS can make sense for a commuter. If you want to visit some friends or discover new routes, it can be of great use.