What's the proper way to play a Trainer like Ultra Ball?
When playing a Trainer you first put it onto the playing field (not directly into the Discard Pile). Then you do what the card says, such as discarding two cards (those go into the Discard Pile right away), searching your Deck, showing the selected Pokemon to your opponent before putting it directly into your hand, shuffling your Deck, etc. Finally, after everything is done, put the Trainer card into the Discard Pile.
Source: TPCi Rules Team (2014-09-18)

Relevant cards

Note: All applicable cards may not be listed below.
XY2_99