It may sound like a pretty straightforward task, but don't be fooled; there's a science to a perfectly tucked-in shirt.
First off, make sure that your shirt is suitable for being tucked in. It should have a full-length hem, with enough extra fabric in the front and rear to stay comfortably in your trousers.
If your shirt has a flat hem or a hem that does not obviously extend below your hips, it will not work well if tucked.
The answer here is simple: leave it untucked.