How to tell the shader which part of an atlas one wants to use as a texture?

As you can see by the title of my question, I am very rookie in what regards messing with the fragment shader. I have experience using the geometry, vertex and calculate shader, though.

Still, what I am trying to is pretty basic: just to access specific textures within a texture atlas. As basic as such a task is, and as much as I search online, it is still unclear to me how to properly locate the texture within the texture atlas. For instance, assume we pass to the shader an atlas of size 256x128, composed by 4x2 textures of 64x64 pixels each, to be stored and sampled in the following variables:

    Texture2D _SpriteTex;
    SamplerState sampler_SpriteTex

How can I inform within the shader the specific part of _SpriteTex that I want to use for the current mesh?

Initially, I thought that it had to do with the following command in the fragment shader:

// Fragment Shader -----------------------------------------------
    float4 frag(frag_input i) : COLOR
    {
        return _SpriteTex.Sample(sampler_SpriteTex, i.tex0);
    }

But the problem is that i.tex0 is one float2 coordinate, making it impossible to specify where a texture within the atlas begins and ends.

Could anyone help out with such a basic misunderstanding? Thanks!

float2 tex_index = float2(0.0, 0.0);
return _SpriteTex.Sample(sampler_SpriteTex, (i.tex0 + tex_index) / float2(4.0, 2.0));

Where tex_index contains 0-3 as first value and 0-1 as second value to index the 8 different textures in the atlas.

@jvo3dc Thanks! It was exactly what I was looking for! I already had a solution, but this is much cleaner and can be passed in one line.