Only can be translated in Spanish as sólo, solamente, único, únicamente:
I only want a sandwich for lunch. -- Sólo quiero un emparedado para almorzar.
It'll only make things more complicated. -- Sólo hará las cosas más complicadas.
She was the only girl in the class with red hair. -- Ella era la única chica pelirroja de la clase.
Just is translated as justo, apenas, and also as sólo (only, merely):
I just want a straight answer, nothing more. -- Sólo quiero una respuesta directa y nada más.
He just missed the bus. -- Justo se le pasó el autobús.