Judging close ball in/out decisions is a skill that simply improves with years of practice - it is likely that you are getting the overwhelming majority of in/out decisions correct already. In many recreational leagues, where the majority of referees officiate, the field markings may be poor, making it very difficult for even the most experienced assistant referee to get these decisions right.
As an assistant referee, you should be positioned half-a-metre to a metre back from the touch line to avoid being struck by players or the ball, level with the offside line (either the second-last defender or the ball).
For close touch line decisions back towards the centre of the field:
- it should be enough to edge and/or lean towards the touchline and turn your head to the left directly over your shoulder
For very close touch line decisions back towards the centre of the field (where the ball remains on or near the touch line for an extended period):
- place flag in the right hand
- face back towards the centre line, parallel to the touch line,
- ensure that as part of your movement, your right foot is landing right next to the touch line for the best angle
- NB be sure to not let the offside line get away from you when you do this, however, as the second-last defender will now be in your far peripheral vision
For touch line decisions when the ball is located further towards the goal line:
- you're already out of position, so sprint!
- face towards the goal line, parallel to the touch line
- ensure the flag is in your left hand
- ensure your left foot is landing right next to the touch line to get the best angle
- NB the referee will most likely now be in your far peripheral vision, so occasionally glance back to ensure you can still see them so that you can make eye contact for the decision
For goal line decisions:
- get into the habit of always following the ball all the way down to goal line
- this means also not signalling until you are stationary at the goal line
- do not assume that the ball is always going to go out
- this will mean you are at the goal line more consistently, and ready to make close calls
- this also ensures that you are close enough to monitor the quick taking of a goal kick / corner kick
- if the ball is on the far side, step inside the field, in front of the corner flag to avoid it getting in your way
Nij's answer states to look at the line rather than the ball. I think my process is to instead look at the outside edge of the line rather than the line itself. It's entirely possible for the ball to still be in play while on the ground, with none of the ball touching the line. Therefore, instead of looking for space, check to see if none of the ball is overhanging the outside edge of the line. If this doesn't happen, the ball must still be in.
If there is any doubt in your mind with these decisions, this is probably because there is space between the ball and the line, but the ball is still overhanging the outside edge of the line. Therefore, as is the general rule with refereeing, you should only make a ball out decision here if you're certain - a missed decision that results in play continuing is usually more forgivable than an incorrect decision that wrongly stops play.
This streamable shows the importance of not making ball out decisions unless you're entirely sure. In the first two views, with a slight angle and in real time, my guess would be that the ball is out by a number of centimetres. It is not until the clip is slowed down with an angle parallel to the goal line that you can see that part of the ball is still overhanging the goal line and the decision is incorrect.