Is it possible to remove the trash icon from the dock on macOS Catalina? I keep cleaning it once any file goes to it even though I have it set to clean automatically. I just deleted an important file thanks to this habit. I’d like to modify things so I can save myself from the practice of quickly emptying trash.

Is there a way to hide the trash can from the dock?
No.

Neither the Trash nor the Finder can be removed from the dock.