Puerto Rico is a wonderful game with a variety of roles you can pick on your turn. Perhaps the most maligned role is the Craftsman role, which produces barrels of goods for you and your opponents.
Here are some tips on how to use the Craftsman role effectively.
Don't pick the Craftsman role.
At least, don't pick it unless you need to. There's a reason most people try to avoid picking craftsman, which is that it often advantages other players more than it advantages you.
The role-picking benefit of an extra barrel of production over other players is usually less important than the benefits of any other role, from Builder's free doubloon to Settler's Quarry, especially early in the game.
Definitely avoid picking Craftsman if the next player can put you in a bad position by picking Captain or Trader.
Players would generally like to pick these two roles, and the only thing preventing them from doing so is that they have no barrels. As soon as you pick Craftsman, you are handing barrels to the next player, who can choose one of those two barrel-using roles.
Either way, you will be last (or at best, second-to-last) in the order on Captain or Trader, which means the barrels you spent your turn producing may not even make it onto a ship or into the trading house.
Building a warehouse is one way to make this a little less painful.
If ships are pretty full or have the wrong kinds of good, having to rot your barrels is always painful. But even if you don't make it onto the ship, a warehouse will at least let you save your four sugar for next round, when you can do some good with them.
If you have a warehouse, you can use craftsman to overload players with goods. This is especially effective if boats are mostly full, leaving players with half a dozen barrels each to fit into two spaces. Everyone else will rot away their excess production, and your warehouse will hold your goods so you can fill a whole ship yourself in a future turn.
Make someone else craft when possible.
Your ideal situation is usually that the player before you crafts, leaving you with first choice on Captain or Trader. Building up your economy and not leaving money on the table is a good way to put the squeeze on other players.
If you can build up enough infrastructure to keep things moving without crafting, and other players need to trade to get money, they'll eventually have to do the crafting for you.
However, there are times when it is smart to craft.
Watching the production capabilities of your opponents is important to figure out when crafting needs to happen. Generally speaking, you want to craft before your opponents can populate their new production.
For example, if you have a coffee monopoly, but your opponent with a coffee plantation just bought a coffee roaster, you want to craft immediately before Mayor is chosen. This ensures your opponent gets no coffee this round, and you maintain your monopoly for as long as possible.
Crafting can also be an important choice when barrels are scarce.
If ships are filling up, or if players are holding goods in a warehouse, or if it's simply the case that everyone is producing lots of the same good, there won't be enough barrels to go around. In this case, production happens clockwise starting with the craftsman, so you'll want to craft first so you can take all the barrels.