Inevitably you will find your ball in a green-side bunker. It happens to all of us. You should be able to hit the ball consistently with a pitch length swing before you can expect predictable results from the sand. This shot can be intimidating but there are simple adjustments you need to make to ensure success. Once you understand how it works, this is a very fun shot to hit.
If you really struggle with this shot, practice your pitching and full swing. The more consistent you become there, the easier this shot is to execute. If you are going out to play keep in mind that it is not uncommon for beginners to take the ball out of the sand and place it on the grass just for pace of play and happiness.* Do what you have to do to make the game more fun.
* If you are playing in any form of competition, refer to a USGA Rules Book on how to proceed properly.