Keylogger

I have a personal Mac desktop (not a laptop). I am just worried about my kids' friends installing something - or my insecure boyfriend for that matter.

Nobody knows any of my passwords. Could somebody do this with their own password? Obviously I know nothing about computers.

So, does that mean if I took the computer to the Mac store and they wiped the whole thing off and installed a new operating system, that I don't have to worry about this?

Thank you so much for your help.