Here's the code to create a new node, check whether the linked list has a head node, and point the next node of the new node to the head if it exists:
```
class LinkedList:
def __init__(self):
self.head = None
self.tail = None
def insert_at_beginning(self, data):
# Create the new node
new_node = Node(data)
# Check whether the linked list has a head node
if self.head:
# Point the next node of the new node to the head
new_node.next = self.head
# Update the head to be the new node
self.head = new_node
else:
# If there is no head, set the new node as both the head and tail
self.head = new_node
self.tail = new_node
```
Note that we also update the `tail` to be the new node if there is no head in the linked list.