I have accidentally toggled something to show some weird dotted lines
These are relationship lines which display the relationship between parented objects. You can disable this in the viewport overlay settings.