what kind of transistor is this?
When you're using a transistor in a circuit, whether it is a BJT (npn or pnp) or mosfet, the first thing you need to do is figure out what transistor you have. Virtually all transistors that aren't from a suspicious source have markings on them that tells you the model. From there, your first step is to google the datasheet. The datasheet will tell you whether the transistor is a BJT or MOSFET, whether it's an npn or pnp BJT or an n-channel or p-channel mosfet. Furthermore, it will show you the different pins and how to identify them. Once you understand what your mystery transistor is, only then can you start designing your circuit.
Since you're trying to build a logic gate, you want to operate the BJT as a switch, in other words, you want it to operate in either the cut off region or saturation region. Once again, referring to the datasheet, you can figure out what voltages are needed to do just that.
Here is a video that goes over how various logic gates using npn BJT transistor work.
https://www.youtube.com/watch?v=sTu3LwpF6XI
Once you understand how it works, you simply need to figure out what transistor you have and bias it correctly.