Work backwards: Expand the desired form to get
[tex]a(x-h)^2+k=a(x^2-2xh+h^2)+k=ax^2-2ahx+ah^2+k[/tex]
Then [tex]a=3[/tex], [tex]-2ah=-5[/tex], and [tex]ah^2+k=1[/tex], from which we get [tex]h=\frac56[/tex] and [tex]k=-\frac{39}{36}=-\frac{13}{12}[/tex]. So we end up with
[tex]3x^2-5x+1=3\left(x-\dfrac56\right)^2-\dfrac{13}{12}[/tex]
Work forwards: Complete the square by writing
[tex]3x^2-5x+1=3\left(x^2-\dfrac53x\right)+1=3\left(x^2-\dfrac53x+\dfrac{25}{36}-\dfrac{25}{36}\right)+1[/tex]
Now we have a perfect square trinomial:
[tex]x^2-\dfrac53x+\dfrac{25}{36}=x^2-2\dfrac56x+\left(\dfrac56\right)^2=\left(x-\dfrac56\right)^2[/tex]
Finally,
[tex]3x^2-5x+1=3\left(x-\dfrac56\right)^2-\dfrac{13}{12}[/tex]
same as before.