There are so many ways to fit the images in shapes they may be created by pen tool or existing one, but the most convenient and standard way to fit any image in the shape is by using clipping mask.
In Photoshop you just have to keep image layer on the top of shape layer and then press & hold alt key and move cursor in between the shape and image layer in layer panel and automatically your mouse cursor convert to clipping icon and then click. this way your image get clip into the shape after that adjust your image according your need.
In illustrator you just have to put shape over the image which you want to clip and select both shape and image layer and press shortcut key Ctrl+7 and then adjust the image.
in Figma you have to put image layer on top of shape and select both layers and press Ctrl+Alt+M and adjust image from property panel.