It is possible to take a picture of an exoplanet if one manages to block the star’s blinding light or if the exoplanet is very far from its star.
Taking a picture of an exoplanet is quite a feat. Exoplanets and their stars are very far away from us, and planets are millions of times fainter than their stars, as stars produce a blinding light that drowns out the planet in a picture. It’s like trying to see a flea on a lightbulb.
To be able to see a planet, you have to be able to block the light coming from the star. This can be done by using a coronagraph, a mask installed inside the telescope to hide the star. This technique is used by several ground-based telescopes, as well as the James Webb Space Telescope. Planets that are very big, very young and very far away from their star are easier to capture in images.
The video below shows images of the star HR8799 and its 4 planets. Three planets in this system were discovered in 2008, and the fourth planet was discovered shortly thereafter. This is the first image of several planets around a star ever taken!
All other detection methods are called indirect methods. They measure the effect that a planet can have on its star, without ever seeing the planet itself. The imaging method is the only direct detection method since it allows astronomers to directly take a photograph of the planet.