Scanning tunneling microscopy study of defects and devices in topological materials