can you defrag an ssd and if so what software is safe?

There’s no need/benefit to defrag a flash-based or solid-state drive.