Since there are all forms energy that your creature can take, it will have to be some kind of proton or charged particle. If your creature is pure light, then it does not have mass, and cannot be captured, so I will try to be as thorough as I can.
A Magnetic Trap is used to trap neutral particles with magnetic moments on the atomic level. Here is a research paper (PDF) that goes into all kinds of details and formulas.
A similar way is used to trap anti-matter, where the magnetic box suspends them. At CERN they use such a device but can only store very small quantities. Documentaries about using this as a form of propulsion show building a large one in space to capture any or store what they manufacture in space.
Here is a peer-reviewed paper (PDF) authored by CERN from the Proceedings of EPAC 2002, Paris, France titled "Photoelectron Trapping In Electric and Magnetic Field"
If you are looking at capturing charged particles, a Penning Trap would be the best option. Also, here is a webpage on the Penning Trap from the Max Planck Institute. Photo of the device is in this page.
For Ions, there is a Ion Trap that uses a combination of electric or magnetic fields.
I did give some thought as to what if your creature takes the form of pure light. There may be two ways that I know of that you can capture such a creature, but you would need to do this in two steps.
The first step is that you need to slow it down to a stop or slow enough to attempt a capture. If the creature is in the form of pure light, then it can move at that speed.
A while back some scientists were able to use a crystal to slow down light. I found the article, it was in the Daily Mail titled: "Scientists stop light completely for a record-breaking MINUTE by trapping it inside a crystal"
The other was more recent and I saw it in a TV documentary where a scientist slowed the speed of light using gases. All I was able to find were articles written in 1999 and 2003.
However, I came across this peer-review paper on arXiv published Feb 2017 entitled "Optical cooling and trapping of highly magnetic atoms: The benefits of a spontaneous spin polarization" which may give you some other idea.
The field of capturing energy, whether real science or SyFi is a very large field. I hope this points you in the direction you seek.
EDITED: After reading B. Lorenz's answer (I voted his answer up), it would depend on how far in the future we are talking about. The question is kind of vague, so I stuck with what we have today.
However, It has been alleged that CERN has already created mini black holes in its Hadron Collider. Since the question does not state how far in the future this will occur, if it is 500, 800 or 1,000+ more years from now, we might have the technology to build a Ghostbusters-like device that sucks in entities that are not only light, but other forms of light energy particles and atoms as well.
This trap will not keep the entity alive like the other solutions I propose. This will kill everything that enters it.
The one thing we need to worry about is the Hawking Radiation and Gamma Rays that may shoot out the open end if the black hole fills up, or if it spins and creates an event horizon, the device could explode, and kill every living creature on the planet.
But 1,000 years from now we'll have a process in place to maybe use the device once and shoot it at the Sun. Since the black hole will kill it, there should be no risk of it coming back after the device burns up in the Sun.
Below are some photos of some of the traps I discussed here, and I will do more research as there should be some peer-review papers on this topic that I can add to this answer, if this doesn't answer your question.
Microchip atomic trap developed in ILS in 2005
Ion trap, shown here is one used for experiments towards realizing a quantum computer.