This is addressed in the upcoming Lemmy release 0.19.4 where contents will no longer be included in API responses. Until then it's up to clients to actually hide it. Content is kept for a few days to allow you to undo deletion, but you can also edit your content before deleting it to remove that. There is also a scheduled task running once a week I believe that will replace contents of deleted comments with something like PERMANENTLY DELETED.
Regardless, as Lemmy is a public platform, you should be aware that people may be storing this information on linked platforms regardless and may not respect the edits/deletions at all.