So what happened was that I was making a datapack. I made a mistake in it and tried renaming the datapack. That wouldn't work so I tried deleting the world itself, but I just go a message saying "file still in use, please close files and try again". I closed every application on my device and restarted it and I still couldn't delete my world, even after going to the world save itself and trying.
Please check if this is still an issue in 1.19.2 or later.