While cloaking devices exist in "Harry Potter" and "Star Trek," real-life versions tend to be less effective. They essentially replicate the effect of fictional cloaking technology, albeit in a much more primitive manner, and usually not in the form of a garment that can be worn.
Scientists have developed several different versions of technology that can be considered an "invisibility cloak" or a cloaking device, and they tend to operate in different ways. In at least one case, researchers were able to create a wearable cloak that helped camouflage the wearer. This cloak, which was developed by Japanese researchers in the early 21st century, used camera and projection technology to record images of what was behind the person and project those images onto the front of the cloak.
This didn't render perfect invisibility but if, for example, the wearer was standing in front of a brick wall, those bricks would be rendered in a digital image on the front of the cloak, making it appear as if the cloak was see-through. This didn't render the wearer invisible as the outline of the garment is still slightly visible.