There are two known ways to provide artificial gravity: centrifugal and accelarative.
Centrifugal artificial gravity takes advantage of apparent acceleration due to centrifugal force. Suitable for space stations and large spaceships, it creates gravity by rotating a cylinder containing habitats. Apparent "down" of a centrifugal system will always point away from the axis of rotation.
Accelerative artificial gravity takes advantage of the burn of a main engine to provide apparent gravity for spaceship inhabitants. Apparent "down" will always point towards the engine providing thrust, promoting a skyscraper layout of a spaceship.